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