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