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