Annotation of parser3/www/htdocs/index.html, revision 1.129
1.104 paf 1: @USE
1.105 paf 2: /derived.p
1.15 paf 3:
1.72 paf 4: @auto[filespec]
5: $selffilespec[$filespec]
1.63 paf 6: #$form:here
1.129 ! paf 7: $request:charset[UTF-8]
1.84 paf 8: #$response:charset[windows-1251]
1.112 paf 9: #$request:charset[windows-1251]
10: #$response:charset[UTF-8]
1.129 ! paf 11: $response:charset[empty]
1.84 paf 12: #$response:content-type[$.value[text/html]$.charset[$response:charset]]
1.15 paf 13:
1.60 paf 14: #@postprocess[body]
15: #<b>$body</b>
16: #$result[123]
1.37 paf 17:
1.15 paf 18: @main[]
1.72 paf 19: #$a(123)
20: #^a.format[%.10u]
1.71 paf 21: #$result[111]
1.70 paf 22: #^f[a]
1.115 paf 23: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
1.88 paf 24: # ^int:sql{select news_id from news where news_id=-1}[
25: ## $.default{2}
26: # ]<br>
1.115 paf 27: # ^hash::sql{bad}
1.88 paf 28: # ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
1.109 paf 29: # ^file::load[text;^string:sql{select 'from sql server' }]
1.95 paf 30: # ^string:sql{select '^^hello[]' }] $ORIGINS(1)
1.96 paf 31: # ^process{ ^^h[]}
1.97 paf 32: # ^process{^string:sql{select '1
33: # ^^hello[]' }] }
1.124 paf 34: # ^double:sql{select '2*' ; }
1.115 paf 35: #}
1.49 paf 36: #^eval(2)
1.48 paf 37: #^tcrashlocaljunctionsv2[]
1.49 paf 38: #^tcrashlocaljunctions[]
1.50 paf 39: #^tjunctions[]
1.47 paf 40: #^replacetest[]
1.48 paf 41: #^matchoptionpp[]
1.46 paf 42: #^txdocxnodechild[]
1.44 paf 43: #^tclasses[]
1.43 paf 44: #$math:PI
45: #^b:method[]
1.42 paf 46: #^main[]
1.41 paf 47: #^errort[]
1.44 paf 48: #^tselectNumber[]
1.39 paf 49: #$result[hello]
1.36 paf 50: #^invaliddate2[]
51: #^process2[]
52: #^casehashtext[]
1.35 paf 53: #^subjvaltest[]
54: #^tableselect0[]
1.34 paf 55: #^memnotest1[]
1.32 paf 56: #^voidparams[]
1.31 paf 57: #^rolls2[]
1.30 paf 58: #^cacheexpireschanging[]
1.29 paf 59: #^cacheexpiresfixed[]
60: #^dateoffsets[]
61: #^exceptionTypes[]
1.28 paf 62: #^roll2[]
1.27 paf 63: #^rolls[]
1.25 paf 64: #^exceptions1[]
1.22 paf 65: #^locate_by_expr[]
1.18 paf 66: #^method_junction_params{...}
1.17 paf 67: #^verifyCookie[paf]
1.37 paf 68: #^execlangs[]
1.16 paf 69: #$t[^tobjeresult[]]$t.a
70: #^xmlprobs[]
1.15 paf 71: #^doubleprobs[]
72: #^math:random(-10)
73: #^divnamestop[]
74: #^arrayclone[]
75: #^operator_tricks[]
76: #^xoutputrusattr[]
77: #^xdocset1[]
78: #^regexp3[]
79: #^exec2[]
80: #^tlock[]
81: #^xmloutattrwithoutvalue[]
82: #^precisionProblem[]
83: #^xpath[]
84: #^ttablesetlang[]
85: #^ttime[]
86: #^tupper[]
87: #^treplace[]
88: #^xslt2[]
89: #^tcache2[]
90: #$ORIGINS(1)
91: #$t[^table::set{a b} ^table::set{c d}]
92: #^ttaintuntaint[]
93: #^tappend2[]
94: #^badvsnprintf[]
95: #^badoracequoting[]
96: #^badconstructors[]
97: #^xloadwrongtable[]
98: #^xsetwrongtable[]
99: #^if($form:test){y}{n}
100: #^tablecolumnerror[]
101: #^roll[]
102: #^cookie2[]
103: #^tableset[]
104: #^math:PI.format{%.30f}
105: #^xchildren[]
106: #^thashforeach3[]
107: #^thashforeach2[]
108: #^thashforeach[]
109: #^thashdelete[]
110: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
111: #^tappend[]
112: #^sappend[]
113: #^eval(10\3)<br>
114: #^tform[]
115: #^formattest[]
116: #^filelist[]
117: #^connect[mysql://user:pass@host]{ }
118: #^безнадёжна_попытка_поправить_непоправимое[]
119: #^tcache[]
120: #^thashfileexp[]
121: #^tcounter[]
122: #^tablehash[]
123: #j^hashfile[]
124: #^formclass[]
125: #^hren[]
126: #^domedit[]
127: #^domxslt[]
128: #^lsplit2[]
129: #^faceesize[]
130: #^imageresize[]
131: #^ifassignhash[]
132: #^tintdefault[]
133: #$response:status[404]
134: #^ifpasshash[]
135: #^movedir[]
136: #^replace[]
137: #^set[]
138: #^hash[]<hr>
139: #$t[^methresult[]] ->$t
140: #^terror[]
141: #^ssave[]
142: #^thash[]
143: #^tdef[]
144: #^ford[]
145: #^tif[]
1.84 paf 146: #^image[]
1.15 paf 147: #^mail2[]
148: #^response[]
149: #^regexp2[]
150: #^ttablerem[]
151: #^pcre[]
152: #^regexp[]<hr>
153: #^mail[]
154: #^exec[]
155: #^fori[]
156: #^tconnect[]
157: #^xslt[]
158: #^xml[]
159: #^header[]
1.53 paf 160: #^tablehasht[]
1.54 paf 161: #^datecreatestring[]
1.56 paf 162: #^mssqltypes1[]
163: #^badthrows[]
1.57 paf 164: #^xmlspace[]
165: #^counter[main.counter]
166: #^xpath2[]
167: #^callindirect[]
168: #^junctionprob[]
1.59 paf 169: #^datecreatestring2[]
170: #^tstoredproc[]
171: #^tstoredproc2[]
172: #^forkeys[]
1.60 paf 173: #^pngsize[]
1.61 paf 174: #^checkList[]
1.63 paf 175: #^datetest[]
1.65 paf 176: #^tserge[]
1.69 paf 177: #^envt[]
1.67 paf 178: #^selectt[]
179: #^select2[]
180: #^selectSingle2[]
181: #^selectString2[]
182: #^selectNumber2[]
183: #^selectBool2[]
184: #^xdoccreate[]
185: #^xdoccreatetag[]
1.70 paf 186: #^xdocload[]
1.67 paf 187: #^xdocstring[]
188: #^xdocsave[]
1.68 paf 189: #^div[]
190: #^datecreatestring3[]
1.73 paf 191: #^tfilespec[]
1.77 paf 192: #^tcrypt[]
1.74 paf 193: #^cryptdocsample[]
1.78 paf 194: #^tnormalize[]
1.83 paf 195: #^xmltransformbyxdoc[]
1.81 paf 196: #^sergestrandef[]
1.83 paf 197: #^tstdin[]
198: #^tfind[]
1.86 paf 199: #^mimet[]
1.92 paf 200: #^joinlimit[]
1.89 paf 201: #^tableclonelimit[]
1.91 paf 202: #^transparams[]
203: #^sendtests[]
1.93 paf 204: #^wwrapperpass[]
1.95 paf 205: #^badpos[]
1.98 paf 206: #^processtest[]
207: #^mail3[]
1.99 paf 208: #^mail4[]
1.100 paf 209: #^datesaving[]
1.101 paf 210: #^badconstructor[]
1.103 paf 211: #^calendar[]
1.104 paf 212: #^monthdays(8)
213: #^xdoctypetest[]
1.105 paf 214: #^xtabletest[]
1.117 paf 215: #^staticstest[]
1.108 paf 216: #^staticstest2[]
1.115 paf 217: #^rbodytest[]
218: #^cookie[]
1.116 paf 219: #^cookieexpirestest[]
1.119 paf 220: #^postest[]
1.120 paf 221: #^voidpostest[]
1.123 paf 222: #^virtualtest[]
1.122 paf 223: #^badcolumntest[]
1.124 paf 224: #^delimiters[]
1.125 paf 225: #^новый-split[]
1.127 paf 226: #^грязные-cookie[]
227: #^html-почта[]
228: #^badswitchtest[]
1.128 paf 229: #^okswitchtest[]
230: ^cgit[]
1.77 paf 231: <hr>
1.74 paf 232: OK
1.127 paf 233:
234: @okswitchtest[]
235: $local[local value]
236: ^switch[1]{
237: ^case[1]{1code $local}
238: }
239:
240: @badswitchtest[]
241: ^switch[1]{
242: ^badswitchtestcase[]
243: }
244: @badswitchtestcase[][local]
245: $local[local value]
246: ^case[1]{1code $local}
247:
248: @badjunction[]
249: ^badj1[]
250: ^badj2[]
251:
252: @html-почта[]
253: $переменная[значение]
254: ^mail:send[
255: $.from[paf@mail]
256: $.to[paf@mail]
257: $.subject[htmltest1]
258: $.html{тест$переменная= !}
259: ]
260:
1.124 paf 261:
262: @грязные-cookie[]
1.126 paf 263: $cookie:a[&]
1.125 paf 264: $cookie:a
1.124 paf 265:
266: @новый-split[]
267: $abc[a.b.c]
268: #$table[^abc.split[.]]
269: #$table[^abc.split[.;l]]
270: #$table[^abc.split[.;v]]
271: $table[^abc.split[.;lv]]
272: ^table.menu{$table.piece}[,]
273: <hr>
274: #$table[^abc.split[.;h]]
275: $table[^abc.split[.;hr]]
276: $table.0,$table.1,$table.2<br>
1.123 paf 277:
278: @delimiters[]
279: $a#1[1]<br>
280: $a#1=<br>
281:
1.121 paf 282:
283: @badcolumntest[]
284: $table[^table::load[ext.cfg]]
285: $table.b
286:
1.120 paf 287:
288: @virtualtest[]
289: $derived[^derived::create[derived create actual param]]
290: ^derived.test[]
291:
1.119 paf 292:
293: @voidpostest[]
294: $s[]
295: ^s.pos[$nothing]
1.118 paf 296:
297: @postest[]
298: $s[$nothing]
299: ^s.pos[$nothing]
1.113 paf 300:
1.115 paf 301: @cookieexpirestest[]
302: #$cookie:exptest[1]
303: #$cookie:exptest[$.value[2] $.expires(+1)]
304: $response:xxxx[^date::now(+10)]
305: $response:yyy[$.value[^date::now(+20)]]
306: $response:yyy[$.value[vvv] $.aaaa[^date::now(+20)]]
307:
1.113 paf 308: @rbodytest[]
309: $request:body=
310: <form method=post>
311: <input type=submit name=paf value=123>
312: </form>
1.107 paf 313:
314: @staticstest2[]
315: ^$derived:derived_var=$derived:derived_var<br>
316: ^$derived:a=$derived:a<br>
1.108 paf 317: $derived:a[changed] ^$derived:a=$derived:a<br>
1.107 paf 318: $derived:derived_var[changed]
319: ^$derived:derived_var=$derived:derived_var<br>
320:
1.105 paf 321: @staticstest[]
322: $derived[^derived::create[]]
323: ^derived.test[]
1.110 paf 324: <hr>
1.106 paf 325: ^$derived.a=$derived.a<br>
326: ^$derived.x=$derived.x<br>
1.110 paf 327: <hr>
328: ^if($derived is derived){derived is derived}{error: derived is not derived}<br>
329: ^if($derived is table){derived is table}{error:derived is not table}<br>
1.111 paf 330: <hr>
331: ^^eval(^$derived)=^eval($derived)<br>
332: ^^if(^$derived)=^if($derived){y}{n}<br>
1.106 paf 333:
1.105 paf 334:
1.104 paf 335: @xdoctypetest[]
336: $xdoc[^xdoc::create[x]]
337: ^if($xdoc is xdoc){y}{n}
338:
339: @xtabletest[]
340: $xtableo[^xtable::create[]]
341: ^if($xtableo is table){y}{n}
1.105 paf 342: #^xtableo.columns[]
1.100 paf 343:
1.103 paf 344: @monthdays[month]
345: $from[^date::create(2000;$month;1)]
346: $to[^date::create($from)] ^to.roll[month](+1)
347: $result($to-$from)
348:
1.100 paf 349: @badconstructor[]
350: ^date::now[]
1.99 paf 351:
352: @datesaving[]
353: $now[^date::now[]]
354: $now.daylightsaving<br>
355: $now.yearday<br>
356: #
357: $date[^date::create(2002;1;3)]
358: $date.daylightsaving<br>
359: $date.yearday
1.97 paf 360:
1.98 paf 361: @mail4[]
362: ^mail:send[
363: $.from[paf@mail.design.ru]
364: $.to[paf@mail.design.ru]
365: $.subject[^taint[uri][москва]=2]
366: $.text[^taint[uri][москва]=]
367: $.html{<a href=http://there.ru/?city=^taint[uri][Москва]>link</a>}
368: ]
1.97 paf 369: @processtest[]
370: $f[^file::load[text;piece.p]] ^process{$f.text}
371: $ORIGINS(1)
1.93 paf 372:
373:
374: @badpos[]
375: $s[123]
1.94 paf 376: ^s.mid(0;2)
1.92 paf 377:
378: @wwrapperpass[]
379: $h[^hash::create[]]
380: $h.a(1)
381: ^my_method[^if(1){$h}]
382: работает. так и должно быть?
383:
384: @my_method[p]
385: ^p._count[]
386:
1.88 paf 387:
388: @tableclonelimit[]
389: $source[^table::create{a
390: aa
391: bb
392: cc}]
393: ^source.offset(1)
394: #$dest[^table::create[$source]]
395: $dest[^table::create[$source;$.offset(2)]]
396: $dest[^table::create[$source;$.limit(2)]]
397: $dest[^table::create[$source;$.offset(1)$.limit(1)]]
398: $dest[^table::create[$source;$.offset(1)$.limit(2)]]
399: $dest[^table::create[$source;$.offset[cur]$.limit(2)]]
400:
401: ^dest.menu{$dest.a}[,]<br>
402:
403: @joinlimit[]
404: $source[^table::create{a
405: aa
406: bb
407: cc}]
408: ^source.offset(2)
409: $dest[^table::create{a
410: xx
411: }]
412: #^dest.join[$source]
413: #^dest.join[$source;$.offset(2)]
414: #^dest.join[$source;$.limit(2)]
415: #^dest.join[$source;$.offset(1)$.limit(1)]
416: #^dest.join[$source;$.offset(1)$.limit(2)]
1.91 paf 417: #^dest.join[$source;$.offset[cur]$.limit(1)]
418: ^dest.join[$source;$.limit(0)]
1.88 paf 419:
420: ^dest.menu{$dest.a}[,]<br>
1.86 paf 421:
422: @cgit[]
423: $f[^file::cgi[showenv.cmd]]
424: $f.HELLO=<br>
425: $f.CONTENT-TYPE=<br>
426: $f.content-type=<br>
427:
1.83 paf 428:
1.84 paf 429: @mimet[]
1.85 paf 430: $f[^file::stat[a.GIF]]
431: $f.content-type
1.84 paf 432:
433:
1.83 paf 434: @tfind[]
435: ^file:find[index.html]
436:
437: @tstdin[]
438: $f[^file::exec[test.pl;$.stdin[проверка stdin потока]]]
439: <pre>$f.text</pre>
1.80 paf 440:
441: @sergestrandef[]
442: $sQuantity[ ]
443: ^sQuantity.int(10)
1.78 paf 444:
445: @xmltransformbyxdoc[]
446: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
447: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
448: <people>
449: <man id="1" имя="word слово">
450: <name>1 2</name>
451: </man>
452: </people>
453: }}]
454: $sheet[^xdoc::create{<?xml version="1.0"?>
1.79 paf 455: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
456:
457: >
1.78 paf 458: <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
459:
1.79 paf 460: <!--<xsl:import href="http://localhost/html.xsl"/>-->
461: <xsl:import href="html.xsl"/>
462:
1.78 paf 463: <xsl:param name="param1">defparam1</xsl:param>
464: <xsl:param name="param2">defparam2</xsl:param>
1.79 paf 465:
1.78 paf 466:
467: <xsl:template match="doc">
468: param1=<xsl:value-of select="^$param1"/><br/>
469: param2=<xsl:value-of select="^$param2"/><br/>
470:
471: test return <something background=""/>
472: </xsl:template>
473:
474: <xsl:template name="test">
1.81 paf 475: test return3
1.78 paf 476: </xsl:template>
477:
478: <xsl:template match="people">
479: <html>
480: <head>z</head>
481: para1=<xsl:copy-of select="^$param1"/>
482: <xsl:apply-templates/>
483: <hr/>
484: <xsl:call-template name="test"/>
485: </html>
486: </xsl:template>
487:
488: <xsl:template match="name">
489: <b><xsl:value-of select="."/></b>
490: </xsl:template>
491: </xsl:stylesheet>
492: }]
493:
494:
495: $xdoc[^xdoc.transform[$sheet]]
496: $string[^xdoc.string[$.method[html]]]
497: ^string.save[a]
498: ^untaint[html]{$string}
499:
500:
1.77 paf 501:
502: @tnormalize[]
503: #s состоит из 1000 фрагментов
504: $s[^for[i](0;999){фрагмент }]
505: #это займет много ресурсов
506: ^s.match[фраг][g]{перга}
507: #это займет меньше ресурсов
508: #$normalized[^s.normalize[]]
509: #^normalized.match[фраг][g]{перга}
1.74 paf 510:
511: @sendtests[]
1.89 paf 512: ^text[]
1.74 paf 513: #^html[]
514: #^text-n-html[]
515: #^file[]
516: #^text-n-file[]
1.89 paf 517: #^text-n-html-n-file[]
1.74 paf 518: #^backwardcomp[]
519:
520: @backwardcomp[]
521: ^mail:send[
522: $.from[paf]
523: $.to[paf]
524: $.body[this is text value]
525: ]
526:
527: @text[]
528: ^mail:send[
529: $.from[paf]
1.90 paf 530: $.to[paf]
1.74 paf 531: $.text[
532: $.value[this is text value]
533: ]
534: ]
535:
536: @html[]
537: ^mail:send[
538: $.from[paf]
539: $.to[paf]
540: $.html{this is <b>html</b> value ^taint[<] 10}
541: ]
542:
543: @text-n-html[]
544: ^mail:send[
545: $.from[paf]
546: $.to[paf]
547: $.text[
548: $.value[this is text value]
549: ]
550: $.html[
551: $.value{this is <b>html</b> value ^taint[<] 10}
552: ]
553: ]
554:
555: @file[]
556: ^mail:send[
557: $.from[paf]
558: $.to[paf]
559: $.file[^file::load[binary;image.jpg]]
560: ]
561:
562: @text-n-file[]
563: ^mail:send[
564: $.from[paf]
565: $.to[paf]
566: $.text[
567: $.value[this is text value]
568: ]
569: $.file[^file::load[binary;image.jpg]]
570: ]
571:
572: @text-n-html-n-file[]
573: ^mail:send[
574: $.from[paf]
575: $.to[paf]
576: $.text[
577: $.value[this is text value]
578: ]
579: $.html[
580: $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
581: $.value{this is <b>html</b> value ^taint[<] 10}
582: ]
583: $.file[^file::load[binary;image.jpg]]
584: ]
585:
586:
587:
588: @md5salt[]
589: 1234
590:
591: @cryptdocsample[]
592: $users[^table::create{name password
593: alice ***
594: bob ***
595: }]
596:
597: $htpasswd[^table::create[nameless]{}]
598: ^users.menu{
599: ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
600: }
601:
602: ^htpasswd.save[nameless;.htpasswd-parser-test]
603:
1.73 paf 604:
605: @tcrypt[]
1.76 paf 606: #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
607: ^math:crypt[123;^$apr1^$]<br>
1.72 paf 608:
609: @tfilespec[]
610: src=$selffilespec<br>
611: dirname=^file:dirname[$selffilespec]<br>
612: basename=^file:basename[$selffilespec]<br>
613: justname=^file:justname[$selffilespec]<br>
614: justext=^file:justext[$selffilespec]<br>
1.68 paf 615:
616: @datecreatestring3[]
617: $new_after[^date::now(-3)]
618: $articles[^table::create{id title last_update
619: 1 привет 2002-07-03}]
620: ^articles.menu{
621: $last_update[^date::create[$articles.last_update]]
622: <a href=${articles.id}.html>$articles.title</a>
623: ^if($last_update > $new_after){новая}
624: <br>
625: }
1.67 paf 626:
627: @div[]
628: $var(5)
629: ^var.inc(7)
630: ^var.dec(3)
631: ^var.div(4)
632: ^var.mul(2)
633: $var
634:
635:
636: @xdocsave[]
637: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
638: <document>
639: строка1<br/>
640: строка2<br/>
641: </document>}]
642: ^document.save[test.xml]
643:
644: @xdocstring[]
645: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
646: <document>
647: строка1<br/>
648: строка2<br/>
649: </document>}]
650: ^document.string[
651: $.method[html]
652: ]
653:
654:
655: @xdocload[]
656: $document[^xdoc::load[article.xml]]
657: $response:body[^document.file[$.media-type[text/xml]]]
658:
659:
660: @xdoccreatetag[]
661: $document[^xdoc::create[document]]
662: $paraNode[^document.createElement[para]]
663: $dummy[^document.documentElement.appendChild[$paraNode]]
664: $response:body[^document.file[$.media-type[text/xml]]]
665:
666:
667: @xdoccreate[]
668: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
669: <document>
670: текст
671: </document>}]
672: $response:body[^document.file[$.media-type[text/xml]]]
673:
674: @selectBool2[]
675: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
676: <t attr="привет" n="123"/>}]
677: ^if(^d.selectBool[/t/@n > 10]){
678: /t/@n больше 10
679: }{
680: не больше
681: }
682:
683:
684: @selectNumber2[]
685: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
686: <t attr="привет" n="123"/>}]
687: ^d.selectNumber[number(/t/@n)+1]<br>
688: ^d.selectNumber[2*2]<br>
689:
690:
691: @selectString2[]
692: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
693: <t attr="привет" n="123"/>}]
694: # результат=привет
695: ^d.selectString[string(t/@attr)]
696:
697:
698: @selectSingle2[]
699: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
700: <t attr="привет" n="123"/>}]
701: # результат=один элемент "t"
702: $element[^d.selectSingle[t]]
703: # результат=2 (количество атрибутов <t>)
704: Количество атрибутов: ^element.attributes._count[]<br>
705: # результат=не существует (нет <x>)
706: ^if(^d.select[x]){
707: x существует
708: }{
709: x не существует
710: }
711:
712: @select2[]
713: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
714: # результат: список из одного элемента "t"
715: $list[^d.select[t]]
716: # результат: 2 = количество атрибутов <t>
717: ^list.0.attributes._count[]<br>
718: ^for[i](0;$list-1){
719: $attr[$list.$i]
720: $attr.nodeName = $attr.nodeType<br>
721: }
722:
723:
724: @selectt[]
725: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
726: $list[^d.select[t]]
727: ^list.0.attributes._count[]
1.65 paf 728:
729: @envt[]
1.66 paf 730: $f[^file::exec[showenv.cmd;
731: $.bad[value]
732: $.CGI_good[value]
733: ]]
1.65 paf 734: $f.status<br>
735: $f.stderr<br>
736: <pre>$f.text</pre>
737:
1.63 paf 738:
739: @tserge[]
1.64 paf 740: ^if(" 09 "){y}
1.61 paf 741:
742: @datetest[]
743: $f[^file::stat[some.zip]]
744: Размер в байтах: $f.size<br>
745: Год создания: $f.cdate.year<br>
746: $now[^date::now[]]
747: $DAYS_CONSIDERED_NEW(3)
748: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
749:
1.60 paf 750:
751: @checkList[]
752: ...^oneOf[a;a,b,c]...<br>
753: #...^oneOf[a;ax,b,c]...<br>
754: ...^oneWord[word]...<br>
755: #...^oneWord[wo rd]...<br>
756:
757:
758: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
759: $t[^list.lsplit[,]]
760: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
761: $result[$s]
762:
763: @oneWord[s]
764: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59 paf 765:
766: @pngsize[]
767: $i[^image::measure[test.png]]
768: ^i.html[]
769:
770:
771: @forkeys[]
772: $text[^form:fields.foreach[key;val]{$key=$val
773: }]
774: ^text.save[ttt.txt]
775: =$text=
776:
777:
778: @tstoredproc2[]
779: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
780: ^void:sql{exec pafvoid}
781: }
782:
783: @tstoredproc[]
784: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
785: $t[^table::sql{exec pafproc}]
786: # $t[^table::sql{{call pafproc}}]
787: $c[^t.columns[]]
788: ^c.menu{$c.column}[<br>]
789: }
1.57 paf 790:
791: @datecreatestring2[]
1.58 paf 792: <table border=1>
793: ^datecreatestring2show[2000]
794: ^datecreatestring2show[2000-02]
1.59 paf 795: ^datecreatestring2show[2000-2-03]
1.58 paf 796: ^datecreatestring2show[2000-02-03 15]
797: ^datecreatestring2show[2000-02-03 15:30]
798: ^datecreatestring2show[2000-02-03 15:30:04]
799: ^datecreatestring2show[2000-02-03 15:30:04 hren]
800: ^datecreatestring2show[15:30]
801: ^datecreatestring2show[15:30:05]
802: ^datecreatestring2show[15:30:05 hren]
803: </table>
804:
805: @datecreatestring2show[s]
806: $date[^date::create[$s]]
807: <tr>
808: <td>$s</td><td align=right>^date.sql-string[]</td>
809: </tr>
810:
1.57 paf 811:
812: @junctionprob[][l]
813: $l[123]
814: $a{$l}
815: ^junctionprobnested[$a]
816: @junctionprobnested[p]
817: $p
818:
819:
820: @callindirecttarget[]
821: callindirecttarget called
822: @callindirect[]
823: $f[$callindirecttarget]
824: ^f[]
825:
826: @xpath2[]
827: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
828: <doc>
829: <field-list>
830: <field name="aa"/>
831: <field name="bb"/>
832: </field-list>
833: </doc>
834: }]
835:
836: #^xdoc.string[]
837:
838: $fieldList[^xdoc.selectSingle[/doc/field-list]]
839: #^fieldList.childNodes._count[]
840: $fields[^fieldList.select[field]]
841: #^fields._count[]
842: ^fields.foreach[k;node]{
843: $node.nodeName<br>
844: }
845: @counter[filespec][f;s]
846: ^file:lock[$filespec]{
847: $f[^file::load[text;$filespec]]
848: $s[^eval($f.text+1)]
849: ^s.save[$filespec]
850: }
851: $s
1.56 paf 852:
853: @xmlspace[]
854: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
855: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
856: <people>
857: <man id="1" имя="word слово">
858: <name>1 2</name>
859: </man>
860: </people>
861: }}]
862: $xdoc[^xdoc.transform[global.xsl]]
863: $string[^xdoc.string[$.method[html]]]
864: ^string.save[a]
865: ^untaint[html]{$string}
866:
867: @badthrows[]
868: #^throw[a;b;]
869: ^throw[a;]
1.54 paf 870:
871: @mssqltypes1[]
872: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 paf 873: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
874: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
875: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
876: $t[^table::sql{select a from paf}]
877: ^t.count[]
1.54 paf 878: }
1.51 paf 879:
1.53 paf 880: @datecreatestring[]
1.54 paf 881: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 882: ^d.sql-string[]
1.52 paf 883:
884: @method[hash]
885: $hash.key
886: @mainZ[]
887: ^method[
888: $.key{code}
889: ]
890:
1.51 paf 891: @tablehasht[]
892: $t[^table::create{p
893: 1
894: 3
895: 2
896: 4}]
897:
898: $h[^t.hash[p]]
899:
900: =^h._count[]=
901:
902:
903: @sqldefaults[]
904: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
905: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
906: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
907: }
1.60 paf 908: =======
909: <hr>
910: OK
911: >>>>>>> 1.50
1.48 paf 912:
913: @tcrashlocaljunctionsv2[]
914: $a[
915: $b{ $c[1] }
916: ]
917: $b
918: $c
919:
920: @tcrashlocaljunctions[]
921: $var[aaa]
922: ^if(1){
923: ^tcrashlocaljunctions1[]
924: }
925:
926: $j
927:
1.49 paf 928: @tcrashlocaljunctions1[][var]
929: $var[varvalue]
1.48 paf 930: $j{
931: $var
932: }
1.49 paf 933: $j
1.48 paf 934:
935: @tjunctions[][tl]
936: $t[^t::create[]]
937: ^tjunctionsi[]
938:
939: @tjunctionsi[][tl]
940: $tl[12345]
941: ^t.tjunctionsm[
942: $.key{
943: $tl
944: }
945: ]
1.46 paf 946:
1.47 paf 947: @replacetest[]
948: $b[b]
949: $s[
950: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
951: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
952: ]
953: ^s.replace[^table::create{from to
954: ba !_}]
955:
956:
1.46 paf 957: @matchoptionpp[]
1.47 paf 958: #$ORIGINS(1)
1.46 paf 959: $s[
960: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47 paf 961: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
962: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
963: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
964: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
965: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
966: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
967: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
968: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
969: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 970: ]
971: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
972:
1.44 paf 973:
974: @txdocxnodechild[]
975: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
976: $xdoc.nodeName
977: ^xdoc.selectNumber[2*2]
1.45 paf 978: $xdoc:ELEMENT_NODE
1.44 paf 979:
980:
981: @tclasses[]
982: $t[^t::create[]]
983: ^t.method[]
984: <hr>
985: ^t.base_method[]
986:
1.40 paf 987:
988: @errort[]
1.42 paf 989: ^xdoc::create[a]
1.40 paf 990: #^throw[user;here;this]
991:
992: @tselectNumber[]
993: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
994: ^d.selectString[string(d/@attr)]<br>
995: ^d.selectNumber[2*2]<br>
996: ^d.selectNumber[number(/d/@n)+1]<br>
997:
1.34 paf 998:
1.36 paf 999: @invaliddate2[]
1000: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
1001:
1002: @process2[]
1003: ^^process{
1004: ^process{
1005: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
1006: }
1007: }
1008:
1.35 paf 1009: @casehashtext[]
1010: $tt[1]
1011: $tmp[
1012: ^switch[$tt]{
1013: ^case[1]{
1014: $.aaa[123]
1015: }
1016: ^case[DEFAULT]{
1017: $.bbb[456]
1018: }
1019: }
1.36 paf 1020: shit!
1.35 paf 1021: ]
1.36 paf 1022: #$tmp
1.35 paf 1023: $tmp.aaa
1024:
1025: @subjvaltest[]
1026: $a12[val]
1027: $b[12]
1028: $a$b
1029:
1.34 paf 1030: @tableselect0[]
1031: $person[^table::create{name height
1032: paf 1.77
1033: шохин 2.07
1034: moko 1.77
1035: }]
1036: $nottoohigh[^person.select($person.height<2)]
1037: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 1038:
1039: @transparams[]
1040: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
1041: $odoc[^idoc.transform[global.xsl;
1042: $.param1['1']
1043: $.param2['2']
1044: ]]
1045: <pre>^taint[^odoc.string[$.method[html]]]
1046:
1047: @memnotest1[]
1048: ^for[i](0;4000){
1049:
1050: $xxxx[$i]
1051: $xxxx
1052:
1053: }
1054:
1055: @memnotest1notes[]
1056: одна итерация цикла:
1057: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 1058: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 1059: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1060: [Mon Apr 8 20:12:02 2002] "|| "
1061: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
1062: [Mon Apr 8 20:12:02 2002] 13:VALUE
1063: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 1064: [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 1065: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
1066: [Mon Apr 8 20:12:02 2002] 17:VALUE
1067: [Mon Apr 8 20:12:02 2002] "i" string
1068: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 1069: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
1070: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 1071: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
1072: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1073: [Mon Apr 8 20:12:02 2002] "| "
1074: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
1075: [Mon Apr 8 20:12:02 2002] 13:VALUE
1076: [Mon Apr 8 20:12:02 2002] "xxxx" string
1077: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
1078: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
1079: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 1080: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 1081: [Mon Apr 8 20:12:02 2002] <-ja returned
1082: [Mon Apr 8 20:12:02 2002] ja->
1083:
1084: 201/328=0.612804878049 %%optimized
1085:
1086: 1.
1087: CREATE_*POOL
1088: сделать
1089: *POOL_POOLED+CODE
1090: где
1091: wwrapper
1092: и(возможно) wcodeframe
1093: +string
1094: стековая переменная
1095:
1096: 2.
1097: избавиться от обёртки при возврате результата process [см. тело _for]
1098:
1099: 3.
1100: сделать callback для process, чтобы вынести invariants из _for & co.
1101:
1102: 4.
1103: @todo склеить get_element и write_value (при вставлении? write_value)
1104:
1105: 5.
1106: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
1107: обёртка сразу выбрасывается = не нужна]
1108:
1109: 6.
1110: process вариант получить именно string, без VString обёртки [часто обёртка
1111: сразу выбрасывается = не нужна]
1112:
1113: 7.
1114: string head, убить 8 байт неправильной link
1.31 paf 1115:
1116: @voidparams[]
1117: ^voidparamsm[$form:field]
1118:
1119: @voidparamsm[p]
1120: ^p.int(123)
1.29 paf 1121:
1.30 paf 1122: @rolls2[]
1123: $now[^date::now[]]
1124: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
1125: ^for[i](1;12){
1126: ^d.roll[month](-1) ^d.sql-string[]<br>
1127: }
1128:
1.29 paf 1129: @cacheexpireschanging[]
1130: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
1131: ^cache[^date::now(+4/24/60/60)]
1132: # ^cache(2)
1.30 paf 1133: # ^cache(0)
1.29 paf 1134: ^math:random(100)
1135: }
1136:
1137:
1138:
1139: @cacheexpiresfixed[]
1140: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
1141: ^math:random(100)
1142: }
1143:
1144: @dateoffsets[]
1145: $d[^date::create(^date::now[]+1/24/60)]
1146: #$d[^date::now(+1/24/60)]
1147: ^d.sql-string[]
1148: #$d
1.26 paf 1149:
1.28 paf 1150: @exceptionTypes[]
1151: # parser.compile ^test[} компиляция (непарная скобка, ...)
1152: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
1153: # number.zerodivision ^eval(1/0) ^eval(1%0)
1154: # number.format ^eval(abc*5)
1155: # file.missing ^file:delete[delme] not found
1156: # file.access ^table::load[.] no rights
1157: # image.format ^image::measure[index.html] not gif/jpg
1158: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
1159: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
1160: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
1161: # smtp.connect not found/timeout
1162: # smtp.execute communication error
1163:
1.26 paf 1164: @roll2[]
1165: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 1166: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 1167:
1.25 paf 1168:
1169: @rolls[]
1170: $d[^date::create(2002;4;4)]
1171: ^d.sql-string[]<br>
1172: ^for[i](1;7){
1173: ^d.roll[day](-1)
1174: ^d.sql-string[]<br>
1175: }
1176: <hr>
1177: $d[^date::create(2002;3;28)]
1178: ^d.sql-string[]<br>
1179: ^for[i](1;7){
1180: ^d.roll[day](+1)
1181: ^d.sql-string[]<br>
1182: }
1183: <hr>
1184: $d[^date::create(2002;12;3)]
1185: ^d.sql-string[]<br>
1186: ^for[i](1;14){
1187: ^d.roll[day](-1)
1188: ^d.sql-string[]<br>
1189: }
1190: <hr>
1191: $d[^date::create(2002;10;19)]
1192: ^d.sql-string[]<br>
1193: ^for[i](1;14){
1194: ^d.roll[day](+1)
1195: ^d.sql-string[]<br>
1196: }
1197:
1198:
1199:
1200:
1201:
1.22 paf 1202:
1203: @exceptions1[]
1204: ^try{
1205: aaa
1.24 paf 1206: ^throw[custom1;paf;is stupid]
1.22 paf 1207: }{
1.24 paf 1208: ^if($exception.type eq custom1){
1.28 paf 1209: # $exception.handled(1)
1210: ^throw[$exception]
1.24 paf 1211: type=$exception.type<br>
1212: source=$exception.source<br>
1213: file=$exception.file<br>
1214: lineno=$exception.lineno<br>
1215: comment=$exception.comment<br>
1216: }
1.22 paf 1217: }
1.21 paf 1218:
1219: @locate_by_expr[]
1220: $t[^table::create{a b
1221: 1 nok
1222: 2 ok
1223: 3 nok
1224: }]
1225: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 1226:
1227: @method_junction_params[param]
1228: ^if($param is junction){junction}{ne junction}
1229:
1230: @verifyCookie[value]
1231: ^if($cookie:dummyvote eq $value){
1232: $result(1)
1233: }{
1234: $cookie:dummyvote[$value]
1235: $result(0)
1236: }
1.16 paf 1237:
1238: @execlangs[]
1.20 paf 1239: $f[^file::exec[test.pl]]
1.36 paf 1240: err:$f.stderr<br>
1.16 paf 1241: ^process{$f.text}
1242: #$c[^t.columns[]]
1243: #^c.menu{
1244: #* $c.column<br>
1245: #}
1.36 paf 1246: c:$t.c<br>
1.16 paf 1247:
1248: @tobjeresult[]
1249: ^table::create{a
1250: 12}
1.15 paf 1251:
1252: @xmlprobs[]
1253: $xmlDataType[^xdoc::load[program.xml]]
1254: #<pre>^taint[^xmlDataType.string[]]
1255: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
1256: #=^xmlDataTypes._count[]=
1257: =^xmlDataTypes.0.getAttribute[type-id]=
1258:
1259: @doubleprobs[]
1260: $1(^math:radians(180))
1261: $2($math:PI)
1262: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
1263: ^if($1==$2){y;n}
1264: ^if(^math:radians(180)==$math:PI){y;n}
1265:
1266:
1267: @divnamestop[]
1268: $a(10)
1269: ^eval($a\3)
1270:
1271: @arrayclone[]
1272: $t[^table::create{a b
1273: 1 11
1274: 2 22
1275: }]
1276: $c[^table::create[$t]]
1277: ^c.append{2 33}
1278: ^t.count[]
1279: ^c.count[]
1280:
1281: @operator_tricks[]
1282: ^if(1){$a[^t[]]}
1283: $a!
1284: $a($b)
1285: ^if(1){y}{n}
1286: $MAIN:a(^t[] eq OK)
1287: #$MAIN:a(1)
1288: ^if($a){y}{n}
1289: #^if(1){y}{n}
1290: $form:if
1291: $a[$.n[1]]
1292: $a.if
1293:
1294: @xoutputrusattr[]
1295: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
1296: ^show_xdoc2[$d]
1297:
1298: @xdocset1[]
1299: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
1300: ^show_xdoc2[$d]
1301:
1302: @regexp3[]
1303: $s[abcАБВ]
1304: ^if(^s.match[][i]){y}{n}
1305:
1306:
1307: @exec2[]
1308: $a[^file::exec[bin/t.cmd]]
1309: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
1310:
1311:
1312: @tlock[]
1313: ^file:lock[lockfile]{
1314: code
1315: }
1316:
1317: @xmloutattrwithoutvalue[]
1318: #$ORIGINS(1)
1319: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
1320: $doc[^doc.transform[global.xsl]]
1321: =^taint[html][^doc.string[$.method[html]]]=
1322:
1323:
1324:
1325: @precisionProblem[]
1326: $a[123456789012345678901234567890]
1327: $b(^a.double[])
1328: ^b.format{%.20E}
1329: <hr>
1330: ^eval(2*2)
1331:
1332: @xpath[]
1333: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1334: <document><block><p>привет</p></block></document>
1335: }]
1336: #^show_xdoc2[$xdoc]
1337: $node[^xdoc.selectSingle[/document/block/p]]
1338: ^if(def $node){
1339: ^if($node is string){
1340: $node
1341: }{
1342: ^if($node is hash){
1343: ^node._count[]
1344: }{
1345: $node.nodeType
1346: }
1347: }
1348: #$node.firstChild.nodeValue
1349: }{
1350: node not found
1351: }
1352:
1353:
1354: @ttablesetlang[]
1355: $a-tab-b[a b
1356: 1 2]
1357:
1358: $t[^table::set{$a-tab-b}]
1359: =$t.a=
1360: <hr>
1361:
1362: $t[^table::set[nameless]{^taint[$a-tab-b]}]
1363: =$t.0=
1364: <hr>
1365:
1366: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
1367: =$t.a=
1368:
1369: #^t.append{1 2}
1370:
1371: @mail3[]
1372: ^mail:send[
1.98 paf 1373: $.from[Александр Петросян <paf@mail.design.ru>]
1374: $.to[Александр Петросян <paf@mail.design.ru>]
1375: $.subject[проверка2]
1.15 paf 1376: $.body[
1377: $.text[
1378: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1.98 paf 1379: $.body[проверка^taint[uri][москва]=]
1.15 paf 1380: ]
1381: $.attachment[
1382: $.value[^file::load[text;index.html]]
1383: $.file-name[привет всем.html]
1384: ]
1385: ]
1386: ]
1387:
1388:
1389: @ttime[]
1390: $now[^date::now[]]
1391: $now.hour:$now.minute
1392:
1393: @tupper[]
1394: $t[abcABCабвАБВ]
1395: $t<br>
1396: ^t.upper[]
1397:
1398: @treplace[]
1399: $copy-paste-clean[^table::set{a b
1400: . _
1401: , _
1402: + _
1403: & _
1404: ? _
1405: = _}]
1406:
1407: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
1408: # почему-то этот replace роняет апач в 500 ошибку :(
1409: #^cache_key.replace[$copy-paste-clean]
1410: $test[abc]
1411: ^test.save[$cache_key]saved<br>
1412: $cache[^file:list[.;\.cache^$]]
1413: ^file:delete[$cache_key]deleted($cache.name)<br>
1414:
1415:
1416:
1417: @xslt2[]
1418: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1419: <document><block><p>привет</p></block></document>
1420: }]
1421: ^show_xdoc2[$xdoc]
1422: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
1423: <hr>
1424:
1425:
1426: @tcache2[]
1427: ^cache[$DB_HOME/keyключ](2){
1428: ^math:random(100)
1429: }
1430:
1431: @ttaintuntaint[]
1432: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
1433:
1434: ]zz
1435: <hr>
1436: ^untaint[html]{1^taint[ ]2 3}
1437:
1438:
1439: @tappend2[]
1440: $t[^table::set{a b}]^t.append{1 2}$t.a
1441:
1442: @badvsnprintf[]
1443: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
1444: }
1445:
1446:
1447: @badoracequoting[]
1448: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
1449: ^connect[$SQL.connect-string]{
1450: ^void:sql{delete from paf}
1451: ^void:sql{insert into paf values (1, '$form:text')}
1452: $paf[^table::sql{select * from paf}]
1453: ^paf.menu{
1454: $paf.id: ^untaint{$paf.block}<hr>
1455:
1456: }
1457: <hr>
1458:
1459:
1460: ^rem{
1461: $news[^table::sql{select description from news}[$.limit(3)]]
1462: ^news.menu{
1463: ^untaint{$news.description}<hr>
1464:
1465: }
1466: <hr>
1467: }
1468:
1469: $tables[^table::sql{select table_name from user_tables}]
1470: ^tables.menu{
1471: $tables.table_name<br>
1472: }
1473:
1474: }
1475: <hr>
1476: $env:PATH
1477:
1478: @badconstructors[]
1479: $bred[^string::length[]]
1480: $bred[^response::clear[]]
1481: $bred[^int::int[]]
1482:
1483:
1484: @xloadwrongtable[]
1485: $constr[^xdoc::load[wrongtable.xml]]
1486: ^show_xdoc2[$constr]
1487:
1488: @xsetwrongtable[]
1489: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
1490: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1491:
1492:
1493: @tablecolumnerror[]
1494: $t[^table::set{a}]
1495: $t.$a
1496:
1497: @roll[]
1498: #$date[^date::set(1970;1;2)]
1499: #^date.roll[month](-1)
1500: $date[^date::set(2038;1;1)]
1501: ^date.roll[month](+1)
1502: $date.year $date.month $date.day
1503:
1504: @cookie2[]
1505: #=$cookie:clientType[$.value[test]]=<br>
1506: =$cookie:clientType=<br>
1507:
1508:
1509: @tableset[]
1510: $a[^table::set{a
1511: 1
1512: 2}]
1513: ^eval(100\$a)
1514:
1515:
1516:
1517: @zzz[]
1518:
1519:
1520: $constructor[
1521: <block1 name="main_srvr" type="0" label="Основное тело" />
1522: <block2 name="main_srvr2" type="0" label="Основное тело" />
1523: ]
1524:
1525: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1526: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1527:
1528: $children[$constr.documentElement.childNodes]
1529: ^if($children){
1530: ^for[i](1;^children._count[]){
1531: $node[$children.$i]
1532: $node.nodeName<br>
1533: }
1534: }
1535:
1536:
1537: @thashforeach3[]
1538: $h[
1539: $.a[1]
1540: $.b[2]
1541: ]
1542: $c[^table::set{a
1543: ^h.foreach[key;value]{$value
1544: }}]
1545: $c.a
1546:
1547: @thashforeach2[]
1548: $h[
1549: $.a[1]
1550: $.b[2]
1551: ]
1552: $c[
1553: ^h.foreach[key;value]{
1554: $.$key[$value]
1555: }
1556: ]
1557: $c.b
1558:
1559: @thashforeach[]
1560: $h[
1561: $.a[1]
1562: $.b[2]
1563: ]
1564: ^h.foreach[key;value]{
1565: $key=$value<br>
1566: }
1567:
1568: @thashdelete[]
1569: $h[$.a[1] $.b[2]]
1570: was:<br>
1571: count=^h._count[] <br>
1572: b='$h.b' <br>
1573:
1574: ^h.delete[b]
1575:
1576: now:<br>
1577: count=^h._count[] <br>
1578: b='$h.b'
1579:
1580: @sappend[]
1581: $test[123]
1582: ^test.save[test]
1583: ^test.save[append;test]
1584:
1585: @tappend[]
1586: $test[^table::set{a b
1587: a1 b1}]
1588: ^test.save[test]
1589: $test[^table::set{a b
1590: a2 b2}]
1591: ^test.save[append;test]
1592:
1593:
1594: @tform[]
1595: ^if(def $form:new_file){y}{n}
1596: <form method="post" enctype="multipart/form-data">
1597: <input type="file" name="new_file" />
1598: <input type=submit>
1599: </input>
1600:
1601: @formattest[]
1602: $size(15.124)
1603:
1604: ^size.format{%.2f}
1605:
1606: @filelist[]
1607: $html[^file:list[.;\.html^$]]
1608: ^html.menu{
1609: $html.name<br>
1610: }
1611: <hr>
1612:
1613: @безнадёжна_попытка_поправить_непоправимое[]
1614: $dom_from_disk[^xdoc::load[input.xml]]
1615: $dom_created_in_air[^xdoc::create[doc]]
1616: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
1617: ^show_xdoc2[$dom_created_in_air]
1618:
1619:
1620: @tcache[]
1621: #^hashfile:clear[cache]
1622: $code[^hashfile::open[$DB_HOME;cache]]
1623: ^code.cache[key](2){
1624: ^math:random(100)
1625: # ^code.delete[]
1626: }
1627:
1628: @thashfileexp[]
1629: $hf[^hashfile::open[$DB_HOME;hashfile]]
1630: $hf.paf[$.value[крут] $.expires(3)]
1631: paf=$hf.paf
1632: <hr>
1633: ^hf.foreach[key;value]{
1634: $key=$value<br>
1635: }
1636: <hr>
1637: $hash[^hf.hash[]]
1638: =$hash.paf=
1639: <hr>
1640:
1641: @tcounter[]
1642: ^tcounterone[$DB_HOME]
1643: other root:
1644: ^tcounterone[${DB_HOME}2]
1645: again, first:
1646: ^tcounterone[$DB_HOME]
1647:
1648: @tcounterone[DB_HOME]
1649: $counter[^hashfile::open[$DB_HOME;counter]]
1650: #^counter.clear[]
1651: ^counter.transaction{
1652: # $counter.value(10)
1653: $counter.value($counter.value+1)
1654: # ^counter.delete[value]
1655: $counter.value
1656: }
1657: <hr>
1658: ^rem{
1659: $hash[^counter.hash[]]
1660: =$hash.value=
1661: <hr>
1662: }
1663:
1664: @tablehash[]
1665: $productList[^table::set{id name
1666: 1 носки
1667: 2 валенки
1668: 3 ушанка
1669: }]
1670:
1671: #скажем, у первого дилера
1672: $firstPriceList[^table::set{id price
1673: 1 0.3
1674: 3 1000
1675: }]
1676:
1677: $firstPriceHash[^firstPriceList.hash[id]]
1678:
1679: ^productList.menu{
1680: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
1681: }
1682:
1683:
1684: @hashfile[]
1685: $hf[^hashfile::assign[hashfile]]
1686: #$hf.paf[крут5]
1687: paf=$hf.paf
1688:
1689: @formclass[]
1690: ^$form:CLASS.a=$form:CLASS.a
1691:
1692: @domdata[]
1693: ^if(1){
1694: # $a{^hren[]}
1695: }
1696: $a
1697: $xdoc[^xdoc::create[doc]]
1698: $doc[$xdoc.documentElement]
1699: $name[^doc.appendChild[^xdoc.createElement[name]]]
1700: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1701: ^untaint[as-is]{=$text.nodeValue=}
1702:
1703: @domedit[]
1704: ^domdata[]
1705: #$paf.nodeName<br>
1706: #$doc.documentElement.nodeName<br>
1707:
1708: ^show_xnode1[$xdoc.documentElement;0;1]
1709: <hr>
1710: ^show_xdoc2[$xdoc]
1711: <hr>
1712:
1713: @domxslt[]
1714: ^domdata[]
1715: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1716: <hr>
1717:
1718: @lsplit2[]
1719: $path[/optics/]
1720: $pathTable[^path.lsplit[/]]
1721: ^pathTable.menu{
1722: ^if(def $pathTable.piece){
1723: =$pathTable.piece=
1724: }
1725: }
1726:
1727:
1728: @faceesize[]
1729: $k(2)
1730: $pict[^image::load[paf.gif]]
1731: $small[^image::create($pict.width/$k;$pict.height/$k)]
1732: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1733: $response:body[^small.gif[]]
1734:
1735: @imageresize[]
1736: $k(2)
1737: $pict[^image::create(400*$k;200*$k)]
1738: $pict.line-width(2)
1739: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1740: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1741: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1742: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
1743: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
1744: $response:body[^pict.gif[]]
1745:
1746: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1747: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1748: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1749:
1750: #$response:body[^small.gif[]]
1751:
1752:
1753: @tintdefault[]
1754: #$abc[abc]
1755: $abc[33]
1756: ^abc.int[z]
1757: #^abc.int(123)
1758:
1759: @ifassignhash[]
1760: $h[^if(1){$.a(1);$.a(2)}]
1761: $h.a
1762:
1763: @ifpasshash[]
1764: $a[$.e[a]]
1765: $b[$.e[b]]
1766: ^ifpasshashdest[^if(1){$a;$b}]
1767: #$x[^if(1){$a}{$b}]
1768: #^ifpasshashdest[$x]
1769:
1770: @ifpasshashdest[p]
1771: $p.e
1772:
1773: @movedir[]
1774: ^file:move[a;deeper/a]
1775:
1776: @replace[]
1777: $a[12^;3]
1778: ^a.replace[^table::set{from to
1779: 2^; !
1780: }]
1781:
1782:
1783: @set[]
1784: ^setdata[]
1785: ^a.add[$b]
1786: add:$a.3<br>
1787:
1788: ^setdata[]
1789: ^a.sub[$b]
1790: sub2:$a.2<br>
1791: sub1:$a.1<br>
1792:
1793: ^setdata[]
1794: $c[^a.union[$b]]
1795: union3:$c.3<br>
1796: union2:$c.2<br>
1797:
1798: ^setdata[]
1799: $c[^a.intersection[$b]]
1800: intersection3:$c.3<br>
1801: intersection2:$c.2<br>
1802:
1803: ^setdata[]
1804: intersects:^if(^a.intersects[$b]){y;n}<br>
1805: intersects2:^if(^a.intersects[ ]){y;n}<br>
1806:
1807:
1808: <hr>
1809:
1810: @setdata[]
1811: $a[$.1[a1] $.2[a2]]
1812: $b[ $.2[b2] $.3[b3]]
1813:
1814:
1815: @hash[]
1816: $h[^hash::create[$._default[123]]]
1817: $h.paf[not kretin]
1818: $h.paf<br>
1819: =$h.that=<br>
1820:
1821: @methresult[]
1822: $result[^table::set{1}]
1823:
1824: @terror[]
1825: ^error[method z must be called with z]
1826:
1827: @syntax1[]
1828: #^a[^b]
1829:
1830: @syntax2[]
1831: #^a[
1832:
1833: @ssave[]
1834: $abc[abc]
1835: ^abc.save[abc]
1836:
1837: @calendar[]
1.103 paf 1838: $year(2002)
1839: $month(12)
1.84 paf 1840: ${year}-${month}:<br>
1841: $week_days[^date:calendar[rus]($year;$month)]
1.15 paf 1842: <pre>
1.101 paf 1843: ^week_days.menu{^for[wday](0;6){^if($week_days.$wday){$week_days.$wday; ^; ^;} }=$week_days.week,$week_days.year=<br>}
1.15 paf 1844: </pre>
1845:
1846: @thash[]
1847: $table[^table::set{id name age
1848: 1 paf 278
1849: 2 пиф 234
1850: }]
1851: $hash[^table.hash[id;^table::set[nameless]{id
1852: name}]]
1853: $hash.2.id $hash.2.name $hash.2.age
1854:
1855: @tdef[]
1856: $s[0]
1857: if 0=^if($s){}{n}<br>
1858: if def 0=^if(def $s){y}{}<br>
1859: <hr>
1860:
1861: @ford[]
1862: ^for[i](0;5){$i}{($i)}
1863:
1864: @tif[]
1865: ^if[def]{y;n}
1866:
1867: @image[]
1868: $pict[^image::create(400;200)]
1869: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
1870: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
1871: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1872: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
1873: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1874: $response:body[^pict.gif[]]
1875:
1876:
1877:
1878: @mail2[]
1879: ^mail:send[
1880: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1881: $.from[Александр Петросян <paf@design.ru>]
1882: $.to[Александр Петросян <paf@design.ru>]
1883: $.subject[проверка]
1884: $.body[проверка]
1885: ]
1886:
1887: @cookie[]
1.115 paf 1888: #$env:HTTP_COOKIE<br>
1.15 paf 1889:
1890: #$cookie:переменная[test тест ТЕСТ2]
1891: =$cookie:переменная=<br>
1892: #$cookie:переменная2[test тест ТЕСТ3]
1893: =$cookie:переменная2=<br>
1894: =$cookie:CLASS.переменная2=<br>
1895:
1896: @response[]
1897: #^if($form:reload){
1898: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1899: #}
1900:
1901: @xslt[]
1902: ^xdata[]
1903: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
1904: ^show_xdoc2[$transformed]
1905:
1906: @regexp2[]
1907: $s[ select]
1908: $s[^s.match[^^\s*][]{!}]
1909: $s
1910:
1911: @header[]
1912: $response:refresh[
1913: $.value[0]
1914: $.url[http://design.ru?a=^taint[123]]
1915: ]
1916:
1917: @ttablerem[]
1918: $table[^table::load[a.cfg]]
1919: ^table.menu{$table.a}
1920:
1921: @tconnect[]
1922: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
1923: $tables[^table::sql{show tables}]
1924: #$cols[^tables.columns[]]
1925: #$cols.column
1926: ^tables.menu{
1927: $tables.[Tables_in_test]<br>
1928: }
1929: }
1930:
1931: @pcre[]
1932: $s[1 2]
1933: ^s.match[\s;ig]{!}
1934: #^s.match[\d;ig]{!}
1935:
1936:
1937: @regexp[]
1938: $s[abcАБВ]
1939: ^if(^s.match[б][i]){y}{n}
1940:
1941: @mail[]
1942: #$ORIGINS(1)
1943: ^mail:send[
1944: $.from[paf@design.ru]
1945: $.to[paf@design.ru]
1946: $.body[1
1947:
1948: 2
1949:
1950:
1951: 3]
1952: ]
1953:
1954: @exec[]
1955: $a[^file::exec[fc.exe;;a;b]]
1956: $a.status|$a.stderr<hr>
1957:
1958: @fori[][i]
1959: ^for[i](1;3){... =$i= ...}
1960:
1961: @xdata0[]
1962: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1963: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
1964: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1965: <people>
1966: <man id="1" имя="word слово">
1967: <name>P«^;AF B</name>
1968: </man>
1969: <man id="2">
1970: <name>ПИФ^taint[&]</name>
1971: </man>
1972: </people>
1973: }]
1974:
1975: @xdata[]
1976: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1977: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1978: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1979: <people>
1980: <man id="1" имя="word слово">
1981: <name>P«^;AF B</name>
1982: </man>
1983: <man id="2">
1984: <name>ПИФ^taint[&]</name>
1985: </man>
1986: </people>
1987: }}]
1988:
1989: @xml[]
1990: ^xdata[]
1991:
1992: ^show_xdoc2[$xdoc]<hr>
1993: #^show_xnode1[$xdoc]<hr>
1994: $people[^xdoc.select[*/man]]
1995: #^show1[]
1996: ^show_xnodes1[$people]<hr>
1997: #^people.0.owner.hren[]
1998:
1999: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
2000:
2001: by id:
2002: ^show_xnode1[^xdoc.getElementById[1];0;1]
2003: <hr>
2004:
2005: @show1[array]
2006: ^for[i](0;^array._count[]-1){
2007: $x[$array.$i]
2008: $x.firstChild.nodeValue:
2009: $pattributes[$x.parentNode.attributes]
2010: ^if(^pattributes._count[]){
2011: $pattributes.id.name=$pattributes.id.nodeValue
2012: }
2013: <br>
2014: }
2015:
2016: @show_xnodes1[array][i]
2017: ^for[i](0;^array._count[]-1){
2018: ^show_xnode1[$array.$i;0;1]
2019: }
2020:
2021: @show_xnode1[x;level;single][l]
2022: ^if(def $x){
2023: ^for[l](0;$level-1){ ^; ^; ^; ^;}
2024: ^if($x.nodeType == $xnode:ELEMENT_NODE){
2025: <^;$x.nodeName
2026: $pairs[$x.attributes]
2027: ^if(def $pairs){
2028: $names[^pairs._keys[]]
2029: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
2030: }
2031: >^;
2032: }{
2033: [$x.nodeType]
2034: }
2035:
2036: ^if(def $x.nodeValue){$x.nodeValue}<br>
2037: ^show_xnode1[$x.firstChild]($level+1)
2038: ^if(!$single){
2039: ^show_xnode1[$x.nextSibling]($level)
2040: }
2041:
2042: ^if($x.nodeType == $xnode:ELEMENT_NODE){
2043: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
2044: }
2045: }
2046:
2047: @show_xdoc2[xdoc]
2048: ^xdoc.save[out/save.xml;
2049: # $.encoding[utf-8]
2050: $.method[xml]
2051: ]
2052: $file[^xdoc.file[
2053: $.encoding[utf-8]
2054: $.method[html]
2055: ]]
2056: ^file.save[text;out/save_file.html]
2057: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
2058: <pre>^taint[html][^xdoc.string[
2059: $.method[html]
2060: # $.encoding[utF-8]
2061: # $.omit-xml-declaration[yes]
2062: # $.standalone[no]
2063: # -$.doctype-public[-//W3C//DTD XHTML]
2064: # -$.doctype-system[/a/b/c/]
2065: # $.indent[yes]
2066: # $.media-type[text/paf]
2067: ]]
2068: </pre>
E-mail: