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