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