Annotation of parser3/www/htdocs/index.html, revision 1.34
1.15 paf 1: #@USE
2: #z/t.p
3:
4: @autoz[]
5: $request:charset[windows-1251]
6: $response:charset[windows-1251]
7: $response:content-type[$.value[text/html]$.charset[$response:charset]]
8:
9: @main[]
1.34 ! paf 10: ^tableselect0[]
! 11: #^memnotest1[]
1.33 paf 12: #^transparams[]
1.32 paf 13: #^voidparams[]
1.31 paf 14: #^rolls2[]
1.30 paf 15: #^cacheexpireschanging[]
1.29 paf 16: #^cacheexpiresfixed[]
17: #^dateoffsets[]
18: #^exceptionTypes[]
1.28 paf 19: #^roll2[]
1.27 paf 20: #^rolls[]
1.25 paf 21: #^exceptions1[]
1.22 paf 22: #^locate_by_expr[]
1.18 paf 23: #^method_junction_params{...}
1.17 paf 24: #^verifyCookie[paf]
1.21 paf 25: #^execlangs[]
1.16 paf 26: #$t[^tobjeresult[]]$t.a
27: #^xmlprobs[]
1.15 paf 28: #^doubleprobs[]
29: #^math:random(-10)
30: #^divnamestop[]
31: #^arrayclone[]
32: #^operator_tricks[]
33: #^xoutputrusattr[]
34: #^xdocset1[]
35: #^regexp3[]
36: #^exec2[]
37: #^tlock[]
38: #^xmloutattrwithoutvalue[]
39: #^precisionProblem[]
40: #^xpath[]
41: #^ttablesetlang[]
42: #^mail3[]
43: #^ttime[]
44: #^tupper[]
45: #^treplace[]
46: #^xslt2[]
47: #^tcache2[]
48: #$ORIGINS(1)
49: #$t[^table::set{a b} ^table::set{c d}]
50: #^ttaintuntaint[]
51: #^tappend2[]
52: #^badvsnprintf[]
53: #^badoracequoting[]
54: #^badconstructors[]
55: #^xloadwrongtable[]
56: #^xsetwrongtable[]
57: #^if($form:test){y}{n}
58: #^tablecolumnerror[]
59: #^roll[]
60: #^cookie2[]
61: #^tableset[]
62: #^math:PI.format{%.30f}
63: #^xchildren[]
64: #^thashforeach3[]
65: #^thashforeach2[]
66: #^thashforeach[]
67: #^thashdelete[]
68: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
69: #^tappend[]
70: #^sappend[]
71: #^eval(10\3)<br>
72: #^tform[]
73: #^formattest[]
74: #^filelist[]
75: #^connect[mysql://user:pass@host]{ }
76: #^безнадёжна_попытка_поправить_непоправимое[]
77: #^tcache[]
78: #^thashfileexp[]
79: #^tcounter[]
80: #^tablehash[]
81: #j^hashfile[]
82: #^formclass[]
83: #^hren[]
84: #^domedit[]
85: #^domxslt[]
86: #^lsplit2[]
87: #^faceesize[]
88: #^imageresize[]
89: #^ifassignhash[]
90: #^tintdefault[]
91: #$response:status[404]
92: #^ifpasshash[]
93: #^movedir[]
94: #^replace[]
95: #^set[]
96: #^hash[]<hr>
97: #$t[^methresult[]] ->$t
98: #^terror[]
99: #^ssave[]
100: #^calendar[]
101: #^thash[]
102: #^tdef[]
103: #^ford[]
104: #^tif[]
105: #^image[]
106: #^mail2[]
107: #^cookie[]
108: #^response[]
109: #^regexp2[]
110: #^ttablerem[]
111: #^pcre[]
112: #^regexp[]<hr>
113: #^mail[]
114: #^exec[]
115: #^fori[]
116: #^tconnect[]
117: #^xslt[]
118: #^xml[]
119: #^header[]
120: <hr>
121: OK
1.34 ! paf 122:
! 123: @tableselect0[]
! 124: $person[^table::create{name height
! 125: paf 1.77
! 126: шохин 2.07
! 127: moko 1.77
! 128: }]
! 129: $nottoohigh[^person.select($person.height<2)]
! 130: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 131:
132: @transparams[]
133: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
134: $odoc[^idoc.transform[global.xsl;
135: $.param1['1']
136: $.param2['2']
137: ]]
138: <pre>^taint[^odoc.string[$.method[html]]]
139:
140: @memnotest1[]
141: ^for[i](0;4000){
142:
143: $xxxx[$i]
144: $xxxx
145:
146: }
147:
148: @memnotest1notes[]
149: одна итерация цикла:
150: [Mon Apr 8 20:12:02 2002] execution-------------------------|
151: '469641+=28 wcodeframe -> 0 optimized[3]''469669+=49 string от {} -> 0 optimized[3]'
152: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
153: [Mon Apr 8 20:12:02 2002] "|| "
154: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
155: [Mon Apr 8 20:12:02 2002] 13:VALUE
156: [Mon Apr 8 20:12:02 2002] "xxxx" string
157: [Mon Apr 8 20:12:02 2002] 14:CREATE_EWPOOL'469377+=24 wcodeframe -> 0 stacked[1]''469401+=49 string -> 41 optimized[7]'
158: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
159: [Mon Apr 8 20:12:02 2002] 17:VALUE
160: [Mon Apr 8 20:12:02 2002] "i" string
161: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
162: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> ~2 actual digits''469492+=49 -> 41'
163: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimized[5]'
164: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
165: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
166: [Mon Apr 8 20:12:02 2002] "| "
167: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
168: [Mon Apr 8 20:12:02 2002] 13:VALUE
169: [Mon Apr 8 20:12:02 2002] "xxxx" string
170: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
171: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
172: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
173: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 optimized[6]'
174: [Mon Apr 8 20:12:02 2002] <-ja returned
175: [Mon Apr 8 20:12:02 2002] ja->
176:
177: 201/328=0.612804878049 %%optimized
178:
179: 1.
180: CREATE_*POOL
181: сделать
182: *POOL_POOLED+CODE
183: где
184: wwrapper
185: и(возможно) wcodeframe
186: +string
187: стековая переменная
188:
189: 2.
190: избавиться от обёртки при возврате результата process [см. тело _for]
191:
192: 3.
193: сделать callback для process, чтобы вынести invariants из _for & co.
194:
195: 4.
196: @todo склеить get_element и write_value (при вставлении? write_value)
197:
198: 5.
199: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
200: обёртка сразу выбрасывается = не нужна]
201:
202: 6.
203: process вариант получить именно string, без VString обёртки [часто обёртка
204: сразу выбрасывается = не нужна]
205:
206: 7.
207: string head, убить 8 байт неправильной link
1.31 paf 208:
209: @voidparams[]
210: ^voidparamsm[$form:field]
211:
212: @voidparamsm[p]
213: ^p.int(123)
1.29 paf 214:
1.30 paf 215: @rolls2[]
216: $now[^date::now[]]
217: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
218: ^for[i](1;12){
219: ^d.roll[month](-1) ^d.sql-string[]<br>
220: }
221:
1.29 paf 222: @cacheexpireschanging[]
223: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
224: ^cache[^date::now(+4/24/60/60)]
225: # ^cache(2)
1.30 paf 226: # ^cache(0)
1.29 paf 227: ^math:random(100)
228: }
229:
230:
231:
232: @cacheexpiresfixed[]
233: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
234: ^math:random(100)
235: }
236:
237: @dateoffsets[]
238: $d[^date::create(^date::now[]+1/24/60)]
239: #$d[^date::now(+1/24/60)]
240: ^d.sql-string[]
241: #$d
1.26 paf 242:
1.28 paf 243: @exceptionTypes[]
244: # parser.compile ^test[} компиляция (непарная скобка, ...)
245: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
246: # number.zerodivision ^eval(1/0) ^eval(1%0)
247: # number.format ^eval(abc*5)
248: # file.missing ^file:delete[delme] not found
249: # file.access ^table::load[.] no rights
250: # image.format ^image::measure[index.html] not gif/jpg
251: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
252: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
253: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
254: # smtp.connect not found/timeout
255: # smtp.execute communication error
256:
1.26 paf 257: @roll2[]
258: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 259: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 260:
1.25 paf 261:
262: @rolls[]
263: $d[^date::create(2002;4;4)]
264: ^d.sql-string[]<br>
265: ^for[i](1;7){
266: ^d.roll[day](-1)
267: ^d.sql-string[]<br>
268: }
269: <hr>
270: $d[^date::create(2002;3;28)]
271: ^d.sql-string[]<br>
272: ^for[i](1;7){
273: ^d.roll[day](+1)
274: ^d.sql-string[]<br>
275: }
276: <hr>
277: $d[^date::create(2002;12;3)]
278: ^d.sql-string[]<br>
279: ^for[i](1;14){
280: ^d.roll[day](-1)
281: ^d.sql-string[]<br>
282: }
283: <hr>
284: $d[^date::create(2002;10;19)]
285: ^d.sql-string[]<br>
286: ^for[i](1;14){
287: ^d.roll[day](+1)
288: ^d.sql-string[]<br>
289: }
290:
291:
292:
293:
294:
1.22 paf 295:
296: @exceptions1[]
297: ^try{
298: aaa
1.24 paf 299: ^throw[custom1;paf;is stupid]
1.22 paf 300: }{
1.24 paf 301: ^if($exception.type eq custom1){
1.28 paf 302: # $exception.handled(1)
303: ^throw[$exception]
1.24 paf 304: type=$exception.type<br>
305: source=$exception.source<br>
306: file=$exception.file<br>
307: lineno=$exception.lineno<br>
308: comment=$exception.comment<br>
309: }
1.22 paf 310: }
1.21 paf 311:
312: @locate_by_expr[]
313: $t[^table::create{a b
314: 1 nok
315: 2 ok
316: 3 nok
317: }]
318: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 319:
320: @method_junction_params[param]
321: ^if($param is junction){junction}{ne junction}
322:
323: @verifyCookie[value]
324: ^if($cookie:dummyvote eq $value){
325: $result(1)
326: }{
327: $cookie:dummyvote[$value]
328: $result(0)
329: }
1.16 paf 330:
331: @execlangs[]
1.20 paf 332: $f[^file::exec[test.pl]]
1.16 paf 333: ^process{$f.text}
334: #$c[^t.columns[]]
335: #^c.menu{
336: #* $c.column<br>
337: #}
338: =$t.c=
339:
340: @tobjeresult[]
341: ^table::create{a
342: 12}
1.15 paf 343:
344: @xmlprobs[]
345: $xmlDataType[^xdoc::load[program.xml]]
346: #<pre>^taint[^xmlDataType.string[]]
347: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
348: #=^xmlDataTypes._count[]=
349: =^xmlDataTypes.0.getAttribute[type-id]=
350:
351: @doubleprobs[]
352: $1(^math:radians(180))
353: $2($math:PI)
354: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
355: ^if($1==$2){y;n}
356: ^if(^math:radians(180)==$math:PI){y;n}
357:
358:
359: @divnamestop[]
360: $a(10)
361: ^eval($a\3)
362:
363: @arrayclone[]
364: $t[^table::create{a b
365: 1 11
366: 2 22
367: }]
368: $c[^table::create[$t]]
369: ^c.append{2 33}
370: ^t.count[]
371: ^c.count[]
372:
373: @operator_tricks[]
374: ^if(1){$a[^t[]]}
375: $a!
376: $a($b)
377: ^if(1){y}{n}
378: $MAIN:a(^t[] eq OK)
379: #$MAIN:a(1)
380: ^if($a){y}{n}
381: #^if(1){y}{n}
382: $form:if
383: $a[$.n[1]]
384: $a.if
385:
386: @xoutputrusattr[]
387: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
388: ^show_xdoc2[$d]
389:
390: @xdocset1[]
391: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
392: ^show_xdoc2[$d]
393:
394: @regexp3[]
395: $s[abcАБВ]
396: ^if(^s.match[][i]){y}{n}
397:
398:
399: @exec2[]
400: $a[^file::exec[bin/t.cmd]]
401: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
402:
403:
404: @tlock[]
405: ^file:lock[lockfile]{
406: code
407: }
408:
409: @xmloutattrwithoutvalue[]
410: #$ORIGINS(1)
411: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
412: $doc[^doc.transform[global.xsl]]
413: =^taint[html][^doc.string[$.method[html]]]=
414:
415:
416:
417: @precisionProblem[]
418: $a[123456789012345678901234567890]
419: $b(^a.double[])
420: ^b.format{%.20E}
421: <hr>
422: ^eval(2*2)
423:
424: @xpath[]
425: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
426: <document><block><p>привет</p></block></document>
427: }]
428: #^show_xdoc2[$xdoc]
429: $node[^xdoc.selectSingle[/document/block/p]]
430: ^if(def $node){
431: ^if($node is string){
432: $node
433: }{
434: ^if($node is hash){
435: ^node._count[]
436: }{
437: $node.nodeType
438: }
439: }
440: #$node.firstChild.nodeValue
441: }{
442: node not found
443: }
444:
445:
446: @ttablesetlang[]
447: $a-tab-b[a b
448: 1 2]
449:
450: $t[^table::set{$a-tab-b}]
451: =$t.a=
452: <hr>
453:
454: $t[^table::set[nameless]{^taint[$a-tab-b]}]
455: =$t.0=
456: <hr>
457:
458: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
459: =$t.a=
460:
461: #^t.append{1 2}
462:
463: @mail3[]
464: ^mail:send[
465: $.from[Александр Петросян <paf@design.ru>]
466: $.to[Александр Петросян <paf@design.ru>]
467: $.subject[проверка4]
468: $.body[
469: $.text[
470: $.content-type[$.value[text/plain] $.charset[windows-1251]]
471: $.body[проверка]
472: ]
473: $.attachment[
474: $.value[^file::load[text;index.html]]
475: $.file-name[привет всем.html]
476: ]
477: ]
478: ]
479:
480:
481: @ttime[]
482: $now[^date::now[]]
483: $now.hour:$now.minute
484:
485: @tupper[]
486: $t[abcABCабвАБВ]
487: $t<br>
488: ^t.upper[]
489:
490: @treplace[]
491: $copy-paste-clean[^table::set{a b
492: . _
493: , _
494: + _
495: & _
496: ? _
497: = _}]
498:
499: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
500: # почему-то этот replace роняет апач в 500 ошибку :(
501: #^cache_key.replace[$copy-paste-clean]
502: $test[abc]
503: ^test.save[$cache_key]saved<br>
504: $cache[^file:list[.;\.cache^$]]
505: ^file:delete[$cache_key]deleted($cache.name)<br>
506:
507:
508:
509: @xslt2[]
510: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
511: <document><block><p>привет</p></block></document>
512: }]
513: ^show_xdoc2[$xdoc]
514: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
515: <hr>
516:
517:
518: @tcache2[]
519: ^cache[$DB_HOME/keyключ](2){
520: ^math:random(100)
521: }
522:
523: @ttaintuntaint[]
524: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
525:
526: ]zz
527: <hr>
528: ^untaint[html]{1^taint[ ]2 3}
529:
530:
531: @tappend2[]
532: $t[^table::set{a b}]^t.append{1 2}$t.a
533:
534: @badvsnprintf[]
535: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
536: }
537:
538:
539: @badoracequoting[]
540: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
541: ^connect[$SQL.connect-string]{
542: ^void:sql{delete from paf}
543: ^void:sql{insert into paf values (1, '$form:text')}
544: $paf[^table::sql{select * from paf}]
545: ^paf.menu{
546: $paf.id: ^untaint{$paf.block}<hr>
547:
548: }
549: <hr>
550:
551:
552: ^rem{
553: $news[^table::sql{select description from news}[$.limit(3)]]
554: ^news.menu{
555: ^untaint{$news.description}<hr>
556:
557: }
558: <hr>
559: }
560:
561: $tables[^table::sql{select table_name from user_tables}]
562: ^tables.menu{
563: $tables.table_name<br>
564: }
565:
566: }
567: <hr>
568: $env:PATH
569:
570: @badconstructors[]
571: $bred[^string::length[]]
572: $bred[^response::clear[]]
573: $bred[^int::int[]]
574:
575:
576: @xloadwrongtable[]
577: $constr[^xdoc::load[wrongtable.xml]]
578: ^show_xdoc2[$constr]
579:
580: @xsetwrongtable[]
581: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
582: <block-list>^untaint[as-is]{$constructor}</block-list>}]
583:
584:
585: @tablecolumnerror[]
586: $t[^table::set{a}]
587: $t.$a
588:
589: @roll[]
590: #$date[^date::set(1970;1;2)]
591: #^date.roll[month](-1)
592: $date[^date::set(2038;1;1)]
593: ^date.roll[month](+1)
594: $date.year $date.month $date.day
595:
596: @cookie2[]
597: #=$cookie:clientType[$.value[test]]=<br>
598: =$cookie:clientType=<br>
599:
600:
601: @tableset[]
602: $a[^table::set{a
603: 1
604: 2}]
605: ^eval(100\$a)
606:
607:
608:
609: @zzz[]
610:
611:
612: $constructor[
613: <block1 name="main_srvr" type="0" label="Основное тело" />
614: <block2 name="main_srvr2" type="0" label="Основное тело" />
615: ]
616:
617: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
618: <block-list>^untaint[as-is]{$constructor}</block-list>}]
619:
620: $children[$constr.documentElement.childNodes]
621: ^if($children){
622: ^for[i](1;^children._count[]){
623: $node[$children.$i]
624: $node.nodeName<br>
625: }
626: }
627:
628:
629: @thashforeach3[]
630: $h[
631: $.a[1]
632: $.b[2]
633: ]
634: $c[^table::set{a
635: ^h.foreach[key;value]{$value
636: }}]
637: $c.a
638:
639: @thashforeach2[]
640: $h[
641: $.a[1]
642: $.b[2]
643: ]
644: $c[
645: ^h.foreach[key;value]{
646: $.$key[$value]
647: }
648: ]
649: $c.b
650:
651: @thashforeach[]
652: $h[
653: $.a[1]
654: $.b[2]
655: ]
656: ^h.foreach[key;value]{
657: $key=$value<br>
658: }
659:
660: @thashdelete[]
661: $h[$.a[1] $.b[2]]
662: was:<br>
663: count=^h._count[] <br>
664: b='$h.b' <br>
665:
666: ^h.delete[b]
667:
668: now:<br>
669: count=^h._count[] <br>
670: b='$h.b'
671:
672: @sappend[]
673: $test[123]
674: ^test.save[test]
675: ^test.save[append;test]
676:
677: @tappend[]
678: $test[^table::set{a b
679: a1 b1}]
680: ^test.save[test]
681: $test[^table::set{a b
682: a2 b2}]
683: ^test.save[append;test]
684:
685:
686: @tform[]
687: ^if(def $form:new_file){y}{n}
688: <form method="post" enctype="multipart/form-data">
689: <input type="file" name="new_file" />
690: <input type=submit>
691: </input>
692:
693: @formattest[]
694: $size(15.124)
695:
696: ^size.format{%.2f}
697:
698: @filelist[]
699: $html[^file:list[.;\.html^$]]
700: ^html.menu{
701: $html.name<br>
702: }
703: <hr>
704:
705: @безнадёжна_попытка_поправить_непоправимое[]
706: $dom_from_disk[^xdoc::load[input.xml]]
707: $dom_created_in_air[^xdoc::create[doc]]
708: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
709: ^show_xdoc2[$dom_created_in_air]
710:
711:
712: @tcache[]
713: #^hashfile:clear[cache]
714: $code[^hashfile::open[$DB_HOME;cache]]
715: ^code.cache[key](2){
716: ^math:random(100)
717: # ^code.delete[]
718: }
719:
720: @thashfileexp[]
721: $hf[^hashfile::open[$DB_HOME;hashfile]]
722: $hf.paf[$.value[крут] $.expires(3)]
723: paf=$hf.paf
724: <hr>
725: ^hf.foreach[key;value]{
726: $key=$value<br>
727: }
728: <hr>
729: $hash[^hf.hash[]]
730: =$hash.paf=
731: <hr>
732:
733: @tcounter[]
734: ^tcounterone[$DB_HOME]
735: other root:
736: ^tcounterone[${DB_HOME}2]
737: again, first:
738: ^tcounterone[$DB_HOME]
739:
740: @tcounterone[DB_HOME]
741: $counter[^hashfile::open[$DB_HOME;counter]]
742: #^counter.clear[]
743: ^counter.transaction{
744: # $counter.value(10)
745: $counter.value($counter.value+1)
746: # ^counter.delete[value]
747: $counter.value
748: }
749: <hr>
750: ^rem{
751: $hash[^counter.hash[]]
752: =$hash.value=
753: <hr>
754: }
755:
756: @tablehash[]
757: $productList[^table::set{id name
758: 1 носки
759: 2 валенки
760: 3 ушанка
761: }]
762:
763: #скажем, у первого дилера
764: $firstPriceList[^table::set{id price
765: 1 0.3
766: 3 1000
767: }]
768:
769: $firstPriceHash[^firstPriceList.hash[id]]
770:
771: ^productList.menu{
772: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
773: }
774:
775:
776: @hashfile[]
777: $hf[^hashfile::assign[hashfile]]
778: #$hf.paf[крут5]
779: paf=$hf.paf
780:
781: @formclass[]
782: ^$form:CLASS.a=$form:CLASS.a
783:
784: @domdata[]
785: ^if(1){
786: # $a{^hren[]}
787: }
788: $a
789: $xdoc[^xdoc::create[doc]]
790: $doc[$xdoc.documentElement]
791: $name[^doc.appendChild[^xdoc.createElement[name]]]
792: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
793: ^untaint[as-is]{=$text.nodeValue=}
794:
795: @domedit[]
796: ^domdata[]
797: #$paf.nodeName<br>
798: #$doc.documentElement.nodeName<br>
799:
800: ^show_xnode1[$xdoc.documentElement;0;1]
801: <hr>
802: ^show_xdoc2[$xdoc]
803: <hr>
804:
805: @domxslt[]
806: ^domdata[]
807: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
808: <hr>
809:
810: @lsplit2[]
811: $path[/optics/]
812: $pathTable[^path.lsplit[/]]
813: ^pathTable.menu{
814: ^if(def $pathTable.piece){
815: =$pathTable.piece=
816: }
817: }
818:
819:
820: @faceesize[]
821: $k(2)
822: $pict[^image::load[paf.gif]]
823: $small[^image::create($pict.width/$k;$pict.height/$k)]
824: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
825: $response:body[^small.gif[]]
826:
827: @imageresize[]
828: $k(2)
829: $pict[^image::create(400*$k;200*$k)]
830: $pict.line-width(2)
831: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
832: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
833: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
834: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
835: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
836: $response:body[^pict.gif[]]
837:
838: #$small[^image::create($pict.width/$k;$pict.height/$k)]
839: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
840: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
841:
842: #$response:body[^small.gif[]]
843:
844:
845: @tintdefault[]
846: #$abc[abc]
847: $abc[33]
848: ^abc.int[z]
849: #^abc.int(123)
850:
851: @ifassignhash[]
852: $h[^if(1){$.a(1);$.a(2)}]
853: $h.a
854:
855: @ifpasshash[]
856: $a[$.e[a]]
857: $b[$.e[b]]
858: ^ifpasshashdest[^if(1){$a;$b}]
859: #$x[^if(1){$a}{$b}]
860: #^ifpasshashdest[$x]
861:
862: @ifpasshashdest[p]
863: $p.e
864:
865: @movedir[]
866: ^file:move[a;deeper/a]
867:
868: @replace[]
869: $a[12^;3]
870: ^a.replace[^table::set{from to
871: 2^; !
872: }]
873:
874:
875: @set[]
876: ^setdata[]
877: ^a.add[$b]
878: add:$a.3<br>
879:
880: ^setdata[]
881: ^a.sub[$b]
882: sub2:$a.2<br>
883: sub1:$a.1<br>
884:
885: ^setdata[]
886: $c[^a.union[$b]]
887: union3:$c.3<br>
888: union2:$c.2<br>
889:
890: ^setdata[]
891: $c[^a.intersection[$b]]
892: intersection3:$c.3<br>
893: intersection2:$c.2<br>
894:
895: ^setdata[]
896: intersects:^if(^a.intersects[$b]){y;n}<br>
897: intersects2:^if(^a.intersects[ ]){y;n}<br>
898:
899:
900: <hr>
901:
902: @setdata[]
903: $a[$.1[a1] $.2[a2]]
904: $b[ $.2[b2] $.3[b3]]
905:
906:
907: @hash[]
908: $h[^hash::create[$._default[123]]]
909: $h.paf[not kretin]
910: $h.paf<br>
911: =$h.that=<br>
912:
913: @methresult[]
914: $result[^table::set{1}]
915:
916: @terror[]
917: ^error[method z must be called with z]
918:
919: @syntax1[]
920: #^a[^b]
921:
922: @syntax2[]
923: #^a[
924:
925: @ssave[]
926: $abc[abc]
927: ^abc.save[abc]
928:
929: @calendar[]
930: 2001;11:<br>
931: $week_days[^date:calendar[rus](2001;11)]
932: <pre>
933: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
934: </pre>
935:
936: @thash[]
937: $table[^table::set{id name age
938: 1 paf 278
939: 2 пиф 234
940: }]
941: $hash[^table.hash[id;^table::set[nameless]{id
942: name}]]
943: $hash.2.id $hash.2.name $hash.2.age
944:
945: @tdef[]
946: $s[0]
947: if 0=^if($s){}{n}<br>
948: if def 0=^if(def $s){y}{}<br>
949: <hr>
950:
951: @ford[]
952: ^for[i](0;5){$i}{($i)}
953:
954: @tif[]
955: ^if[def]{y;n}
956:
957: @image[]
958: $pict[^image::create(400;200)]
959: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
960: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
961: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
962: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
963: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
964: $response:body[^pict.gif[]]
965:
966:
967:
968: @mail2[]
969: ^mail:send[
970: $.content-type[$.value[text/plain] $.charset[windows-1251]]
971: $.from[Александр Петросян <paf@design.ru>]
972: $.to[Александр Петросян <paf@design.ru>]
973: $.subject[проверка]
974: $.body[проверка]
975: ]
976:
977: @cookie[]
978: $env:HTTP_COOKIE<br>
979:
980: #$cookie:переменная[test тест ТЕСТ2]
981: =$cookie:переменная=<br>
982: #$cookie:переменная2[test тест ТЕСТ3]
983: =$cookie:переменная2=<br>
984: =$cookie:CLASS.переменная2=<br>
985:
986: @response[]
987: #^if($form:reload){
988: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
989: #}
990:
991: @xslt[]
992: ^xdata[]
993: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
994: ^show_xdoc2[$transformed]
995:
996: @regexp2[]
997: $s[ select]
998: $s[^s.match[^^\s*][]{!}]
999: $s
1000:
1001: @header[]
1002: $response:refresh[
1003: $.value[0]
1004: $.url[http://design.ru?a=^taint[123]]
1005: ]
1006:
1007: @ttablerem[]
1008: $table[^table::load[a.cfg]]
1009: ^table.menu{$table.a}
1010:
1011: @tconnect[]
1012: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1013: $tables[^table::sql{show tables}]
1014: #$cols[^tables.columns[]]
1015: #$cols.column
1016: ^tables.menu{
1017: $tables.[Tables_in_test]<br>
1018: }
1019: }
1020:
1021: @pcre[]
1022: $s[1 2]
1023: ^s.match[\s;ig]{!}
1024: #^s.match[\d;ig]{!}
1025:
1026:
1027: @regexp[]
1028: $s[abcАБВ]
1029: ^if(^s.match[б][i]){y}{n}
1030:
1031: @mail[]
1032: #$ORIGINS(1)
1033: ^mail:send[
1034: $.from[paf@design.ru]
1035: $.to[paf@design.ru]
1036: $.body[1
1037:
1038: 2
1039:
1040:
1041: 3]
1042: ]
1043:
1044: @exec[]
1045: $a[^file::exec[fc.exe;;a;b]]
1046: $a.status|$a.stderr<hr>
1047:
1048: @fori[][i]
1049: ^for[i](1;3){... =$i= ...}
1050:
1051: @xdata0[]
1052: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1053: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1054: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1055: <people>
1056: <man id="1" имя="word слово">
1057: <name>P«^;AF B</name>
1058: </man>
1059: <man id="2">
1060: <name>ПИФ^taint[&]</name>
1061: </man>
1062: </people>
1063: }]
1064:
1065: @xdata[]
1066: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1067: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1068: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1069: <people>
1070: <man id="1" имя="word слово">
1071: <name>P«^;AF B</name>
1072: </man>
1073: <man id="2">
1074: <name>ПИФ^taint[&]</name>
1075: </man>
1076: </people>
1077: }}]
1078:
1079: @xml[]
1080: ^xdata[]
1081:
1082: ^show_xdoc2[$xdoc]<hr>
1083: #^show_xnode1[$xdoc]<hr>
1084: $people[^xdoc.select[*/man]]
1085: #^show1[]
1086: ^show_xnodes1[$people]<hr>
1087: #^people.0.owner.hren[]
1088:
1089: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1090:
1091: by id:
1092: ^show_xnode1[^xdoc.getElementById[1];0;1]
1093: <hr>
1094:
1095: @show1[array]
1096: ^for[i](0;^array._count[]-1){
1097: $x[$array.$i]
1098: $x.firstChild.nodeValue:
1099: $pattributes[$x.parentNode.attributes]
1100: ^if(^pattributes._count[]){
1101: $pattributes.id.name=$pattributes.id.nodeValue
1102: }
1103: <br>
1104: }
1105:
1106: @show_xnodes1[array][i]
1107: ^for[i](0;^array._count[]-1){
1108: ^show_xnode1[$array.$i;0;1]
1109: }
1110:
1111: @show_xnode1[x;level;single][l]
1112: ^if(def $x){
1113: ^for[l](0;$level-1){ ^; ^; ^; ^;}
1114: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1115: <^;$x.nodeName
1116: $pairs[$x.attributes]
1117: ^if(def $pairs){
1118: $names[^pairs._keys[]]
1119: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
1120: }
1121: >^;
1122: }{
1123: [$x.nodeType]
1124: }
1125:
1126: ^if(def $x.nodeValue){$x.nodeValue}<br>
1127: ^show_xnode1[$x.firstChild]($level+1)
1128: ^if(!$single){
1129: ^show_xnode1[$x.nextSibling]($level)
1130: }
1131:
1132: ^if($x.nodeType == $xnode:ELEMENT_NODE){
1133: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
1134: }
1135: }
1136:
1137: @show_xdoc2[xdoc]
1138: ^xdoc.save[out/save.xml;
1139: # $.encoding[utf-8]
1140: $.method[xml]
1141: ]
1142: $file[^xdoc.file[
1143: $.encoding[utf-8]
1144: $.method[html]
1145: ]]
1146: ^file.save[text;out/save_file.html]
1147: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
1148: <pre>^taint[html][^xdoc.string[
1149: $.method[html]
1150: # $.encoding[utF-8]
1151: # $.omit-xml-declaration[yes]
1152: # $.standalone[no]
1153: # -$.doctype-public[-//W3C//DTD XHTML]
1154: # -$.doctype-system[/a/b/c/]
1155: # $.indent[yes]
1156: # $.media-type[text/paf]
1157: ]]
1158: </pre>
E-mail: