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