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