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