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