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