Annotation of parser3/www/htdocs/index.html, revision 1.8
1.6 paf 1: #@USE
2: #z/t.p
1.1 paf 3:
1.6 paf 4: @autoz[]
5: $request:charset[windows-1251]
6: $response:charset[windows-1251]
7: $response:content-type[$.value[text/html]$.charset[$response:charset]]
8:
9: @main[]
1.8 ! paf 10: ^math:random(-10)
! 11: #^divnamestop[]
1.7 paf 12: #^arrayclone[]
1.6 paf 13: #^operator_tricks[]
14: #^xoutputrusattr[]
15: #^xdocset1[]
16: #^regexp3[]
17: #^exec2[]
18: #^tlock[]
19: #^xmloutattrwithoutvalue[]
20: #^precisionProblem[]
21: #^xpath[]
22: #^ttablesetlang[]
23: #^mail3[]
24: #^ttime[]
25: #^tupper[]
26: #^treplace[]
27: #^xslt2[]
28: #^tcache2[]
29: #$ORIGINS(1)
30: #$t[^table::set{a b} ^table::set{c d}]
31: #^ttaintuntaint[]
32: #^tappend2[]
33: #^badvsnprintf[]
34: #^badoracequoting[]
35: #^badconstructors[]
36: #^xloadwrongtable[]
37: #^xsetwrongtable[]
38: #^if($form:test){y}{n}
39: #^tablecolumnerror[]
40: #^roll[]
41: #^cookie2[]
42: #^tableset[]
43: #^math:PI.format{%.30f}
44: #^xchildren[]
45: #^thashforeach3[]
46: #^thashforeach2[]
47: #^thashforeach[]
48: #^thashdelete[]
49: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
50: #^tappend[]
51: #^sappend[]
52: #^eval(10\3)<br>
53: #^tform[]
54: #^formattest[]
55: #^filelist[]
56: #^connect[mysql://user:pass@host]{ }
57: #^безнадёжна_попытка_поправить_непоправимое[]
58: #^tcache[]
59: #^thashfileexp[]
60: #^tcounter[]
61: #^tablehash[]
62: #j^hashfile[]
63: #^formclass[]
64: #^hren[]
65: #^domedit[]
66: #^domxslt[]
67: #^lsplit2[]
68: #^faceesize[]
69: #^imageresize[]
70: #^ifassignhash[]
71: #^tintdefault[]
72: #$response:status[404]
73: #^ifpasshash[]
74: #^movedir[]
75: #^replace[]
76: #^set[]
77: #^hash[]<hr>
78: #$t[^methresult[]] ->$t
79: #^terror[]
80: #^ssave[]
81: #^calendar[]
82: #^thash[]
83: #^tdef[]
84: #^ford[]
85: #^tif[]
86: #^image[]
87: #^mail2[]
88: #^cookie[]
89: #^response[]
90: #^regexp2[]
91: #^ttablerem[]
92: #^pcre[]
93: #^regexp[]<hr>
94: #^mail[]
95: #^exec[]
96: #^fori[]
97: #^tconnect[]
98: #^xslt[]
99: #^xml[]
100: #^header[]
101: <hr>
102: OK
1.7 paf 103:
104: @divnamestop[]
105: $a(10)
106: ^eval($a\3)
1.6 paf 107:
108: @arrayclone[]
109: $t[^table::create{a b
110: 1 11
111: 2 22
112: }]
113: $c[^table::create[$t]]
114: ^c.append{2 33}
115: ^t.count[]
116: ^c.count[]
117:
118: @operator_tricks[]
119: ^if(1){$a[^t[]]}
120: $a!
121: $a($b)
122: ^if(1){y}{n}
123: $MAIN:a(^t[] eq OK)
124: #$MAIN:a(1)
125: ^if($a){y}{n}
126: #^if(1){y}{n}
127: $form:if
128: $a[$.n[1]]
129: $a.if
130:
131: @xoutputrusattr[]
132: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
133: ^show_xdoc2[$d]
134:
135: @xdocset1[]
136: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
137: ^show_xdoc2[$d]
138:
139: @regexp3[]
140: $s[abcАБВ]
141: ^if(^s.match[][i]){y}{n}
142:
143:
144: @exec2[]
145: $a[^file::exec[bin/t.cmd]]
146: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
147:
148:
149: @tlock[]
150: ^file:lock[lockfile]{
151: code
1.1 paf 152: }
153:
1.6 paf 154: @xmloutattrwithoutvalue[]
155: #$ORIGINS(1)
156: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
157: $doc[^doc.transform[global.xsl]]
158: =^taint[html][^doc.string[$.method[html]]]=
159:
160:
161:
162: @precisionProblem[]
163: $a[123456789012345678901234567890]
164: $b(^a.double[])
165: ^b.format{%.20E}
166: <hr>
167: ^eval(2*2)
168:
169: @xpath[]
170: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
171: <document><block><p>привет</p></block></document>
172: }]
173: #^show_xdoc2[$xdoc]
174: $node[^xdoc.selectSingle[/document/block/p]]
175: ^if(def $node){
176: ^if($node is string){
177: $node
1.1 paf 178: }{
1.6 paf 179: ^if($node is hash){
180: ^node._count[]
181: }{
182: $node.nodeType
183: }
1.1 paf 184: }
1.6 paf 185: #$node.firstChild.nodeValue
186: }{
187: node not found
188: }
189:
190:
191: @ttablesetlang[]
192: $a-tab-b[a b
193: 1 2]
194:
195: $t[^table::set{$a-tab-b}]
196: =$t.a=
197: <hr>
198:
199: $t[^table::set[nameless]{^taint[$a-tab-b]}]
200: =$t.0=
201: <hr>
202:
203: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
204: =$t.a=
205:
206: #^t.append{1 2}
207:
208: @mail3[]
209: ^mail:send[
210: $.from[Александр Петросян <paf@design.ru>]
211: $.to[Александр Петросян <paf@design.ru>]
212: $.subject[проверка4]
213: $.body[
214: $.text[
215: $.content-type[$.value[text/plain] $.charset[windows-1251]]
216: $.body[проверка]
217: ]
218: $.attachment[
219: $.value[^file::load[text;index.html]]
220: $.file-name[привет всем.html]
221: ]
222: ]
223: ]
224:
225:
226: @ttime[]
227: $now[^date::now[]]
228: $now.hour:$now.minute
229:
230: @tupper[]
231: $t[abcABCабвАБВ]
232: $t<br>
233: ^t.upper[]
234:
235: @treplace[]
236: $copy-paste-clean[^table::set{a b
237: . _
238: , _
239: + _
240: & _
241: ? _
242: = _}]
243:
244: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
245: # почему-то этот replace роняет апач в 500 ошибку :(
246: #^cache_key.replace[$copy-paste-clean]
247: $test[abc]
248: ^test.save[$cache_key]saved<br>
249: $cache[^file:list[.;\.cache^$]]
250: ^file:delete[$cache_key]deleted($cache.name)<br>
251:
252:
253:
254: @xslt2[]
255: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
256: <document><block><p>привет</p></block></document>
257: }]
258: ^show_xdoc2[$xdoc]
259: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
260: <hr>
261:
262:
263: @tcache2[]
264: ^cache[$DB_HOME/keyключ](2){
265: ^math:random(100)
266: }
267:
268: @ttaintuntaint[]
269: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
270:
271: ]zz
272: <hr>
273: ^untaint[html]{1^taint[ ]2 3}
274:
275:
276: @tappend2[]
277: $t[^table::set{a b}]^t.append{1 2}$t.a
278:
279: @badvsnprintf[]
280: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
281: }
282:
283:
284: @badoracequoting[]
285: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
286: ^connect[$SQL.connect-string]{
287: ^void:sql{delete from paf}
288: ^void:sql{insert into paf values (1, '$form:text')}
289: $paf[^table::sql{select * from paf}]
290: ^paf.menu{
291: $paf.id: ^untaint{$paf.block}<hr>
292:
293: }
294: <hr>
295:
296:
297: ^rem{
298: $news[^table::sql{select description from news}[$.limit(3)]]
299: ^news.menu{
300: ^untaint{$news.description}<hr>
301:
302: }
303: <hr>
304: }
305:
306: $tables[^table::sql{select table_name from user_tables}]
307: ^tables.menu{
308: $tables.table_name<br>
309: }
310:
311: }
312: <hr>
313: $env:PATH
314:
315: @badconstructors[]
316: $bred[^string::length[]]
317: $bred[^response::clear[]]
318: $bred[^int::int[]]
319:
320:
321: @xloadwrongtable[]
322: $constr[^xdoc::load[wrongtable.xml]]
323: ^show_xdoc2[$constr]
324:
325: @xsetwrongtable[]
326: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
327: <block-list>^untaint[as-is]{$constructor}</block-list>}]
328:
329:
330: @tablecolumnerror[]
331: $t[^table::set{a}]
332: $t.$a
333:
334: @roll[]
335: #$date[^date::set(1970;1;2)]
336: #^date.roll[month](-1)
337: $date[^date::set(2038;1;1)]
338: ^date.roll[month](+1)
339: $date.year $date.month $date.day
340:
341: @cookie2[]
342: #=$cookie:clientType[$.value[test]]=<br>
343: =$cookie:clientType=<br>
344:
345:
346: @tableset[]
347: $a[^table::set{a
348: 1
349: 2}]
350: ^eval(100\$a)
351:
352:
353:
354: @zzz[]
355:
356:
357: $constructor[
358: <block1 name="main_srvr" type="0" label="Основное тело" />
359: <block2 name="main_srvr2" type="0" label="Основное тело" />
360: ]
361:
362: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
363: <block-list>^untaint[as-is]{$constructor}</block-list>}]
364:
365: $children[$constr.documentElement.childNodes]
366: ^if($children){
367: ^for[i](1;^children._count[]){
368: $node[$children.$i]
369: $node.nodeName<br>
370: }
371: }
372:
373:
374: @thashforeach3[]
375: $h[
376: $.a[1]
377: $.b[2]
378: ]
379: $c[^table::set{a
380: ^h.foreach[key;value]{$value
381: }}]
382: $c.a
383:
384: @thashforeach2[]
385: $h[
386: $.a[1]
387: $.b[2]
388: ]
389: $c[
390: ^h.foreach[key;value]{
391: $.$key[$value]
392: }
393: ]
394: $c.b
395:
396: @thashforeach[]
397: $h[
398: $.a[1]
399: $.b[2]
400: ]
401: ^h.foreach[key;value]{
402: $key=$value<br>
403: }
404:
405: @thashdelete[]
406: $h[$.a[1] $.b[2]]
407: was:<br>
408: count=^h._count[] <br>
409: b='$h.b' <br>
410:
411: ^h.delete[b]
412:
413: now:<br>
414: count=^h._count[] <br>
415: b='$h.b'
416:
417: @sappend[]
418: $test[123]
419: ^test.save[test]
420: ^test.save[append;test]
421:
422: @tappend[]
423: $test[^table::set{a b
424: a1 b1}]
425: ^test.save[test]
426: $test[^table::set{a b
427: a2 b2}]
428: ^test.save[append;test]
429:
430:
431: @tform[]
432: ^if(def $form:new_file){y}{n}
433: <form method="post" enctype="multipart/form-data">
434: <input type="file" name="new_file" />
435: <input type=submit>
436: </input>
437:
438: @formattest[]
439: $size(15.124)
440:
441: ^size.format{%.2f}
442:
443: @filelist[]
444: $html[^file:list[.;\.html^$]]
445: ^html.menu{
446: $html.name<br>
1.1 paf 447: }
1.6 paf 448: <hr>
1.1 paf 449:
1.6 paf 450: @безнадёжна_попытка_поправить_непоправимое[]
451: $dom_from_disk[^xdoc::load[input.xml]]
452: $dom_created_in_air[^xdoc::create[doc]]
453: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
454: ^show_xdoc2[$dom_created_in_air]
1.1 paf 455:
1.6 paf 456:
457: @tcache[]
458: #^hashfile:clear[cache]
459: $code[^hashfile::open[$DB_HOME;cache]]
460: ^code.cache[key](2){
461: ^math:random(100)
462: # ^code.delete[]
463: }
464:
465: @thashfileexp[]
466: $hf[^hashfile::open[$DB_HOME;hashfile]]
467: $hf.paf[$.value[крут] $.expires(3)]
468: paf=$hf.paf
469: <hr>
470: ^hf.foreach[key;value]{
471: $key=$value<br>
472: }
473: <hr>
474: $hash[^hf.hash[]]
475: =$hash.paf=
476: <hr>
477:
478: @tcounter[]
479: ^tcounterone[$DB_HOME]
480: other root:
481: ^tcounterone[${DB_HOME}2]
482: again, first:
483: ^tcounterone[$DB_HOME]
484:
485: @tcounterone[DB_HOME]
486: $counter[^hashfile::open[$DB_HOME;counter]]
487: #^counter.clear[]
488: ^counter.transaction{
489: # $counter.value(10)
490: $counter.value($counter.value+1)
491: # ^counter.delete[value]
492: $counter.value
493: }
494: <hr>
495: ^rem{
496: $hash[^counter.hash[]]
497: =$hash.value=
498: <hr>
499: }
500:
501: @tablehash[]
502: $productList[^table::set{id name
503: 1 носки
504: 2 валенки
505: 3 ушанка
506: }]
507:
508: #скажем, у первого дилера
509: $firstPriceList[^table::set{id price
510: 1 0.3
511: 3 1000
512: }]
513:
514: $firstPriceHash[^firstPriceList.hash[id]]
515:
516: ^productList.menu{
517: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
518: }
519:
520:
521: @hashfile[]
522: $hf[^hashfile::assign[hashfile]]
523: #$hf.paf[крут5]
524: paf=$hf.paf
525:
526: @formclass[]
527: ^$form:CLASS.a=$form:CLASS.a
528:
529: @domdata[]
530: ^if(1){
531: # $a{^hren[]}
532: }
533: $a
534: $xdoc[^xdoc::create[doc]]
535: $doc[$xdoc.documentElement]
536: $name[^doc.appendChild[^xdoc.createElement[name]]]
537: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
538: ^untaint[as-is]{=$text.nodeValue=}
539:
540: @domedit[]
541: ^domdata[]
542: #$paf.nodeName<br>
543: #$doc.documentElement.nodeName<br>
544:
545: ^show_xnode1[$xdoc.documentElement;0;1]
546: <hr>
547: ^show_xdoc2[$xdoc]
548: <hr>
549:
550: @domxslt[]
551: ^domdata[]
552: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
553: <hr>
554:
555: @lsplit2[]
556: $path[/optics/]
557: $pathTable[^path.lsplit[/]]
558: ^pathTable.menu{
559: ^if(def $pathTable.piece){
560: =$pathTable.piece=
1.1 paf 561: }
1.6 paf 562: }
563:
564:
565: @faceesize[]
566: $k(2)
567: $pict[^image::load[paf.gif]]
568: $small[^image::create($pict.width/$k;$pict.height/$k)]
569: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
570: $response:body[^small.gif[]]
571:
572: @imageresize[]
573: $k(2)
574: $pict[^image::create(400*$k;200*$k)]
575: $pict.line-width(2)
576: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
577: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
578: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
579: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
580: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
581: $response:body[^pict.gif[]]
582:
583: #$small[^image::create($pict.width/$k;$pict.height/$k)]
584: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
585: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
586:
587: #$response:body[^small.gif[]]
588:
589:
590: @tintdefault[]
591: #$abc[abc]
592: $abc[33]
593: ^abc.int[z]
594: #^abc.int(123)
595:
596: @ifassignhash[]
597: $h[^if(1){$.a(1);$.a(2)}]
598: $h.a
599:
600: @ifpasshash[]
601: $a[$.e[a]]
602: $b[$.e[b]]
603: ^ifpasshashdest[^if(1){$a;$b}]
604: #$x[^if(1){$a}{$b}]
605: #^ifpasshashdest[$x]
606:
607: @ifpasshashdest[p]
608: $p.e
609:
610: @movedir[]
611: ^file:move[a;deeper/a]
612:
613: @replace[]
614: $a[12^;3]
615: ^a.replace[^table::set{from to
616: 2^; !
617: }]
618:
619:
620: @set[]
621: ^setdata[]
622: ^a.add[$b]
623: add:$a.3<br>
624:
625: ^setdata[]
626: ^a.sub[$b]
627: sub2:$a.2<br>
628: sub1:$a.1<br>
629:
630: ^setdata[]
631: $c[^a.union[$b]]
632: union3:$c.3<br>
633: union2:$c.2<br>
634:
635: ^setdata[]
636: $c[^a.intersection[$b]]
637: intersection3:$c.3<br>
638: intersection2:$c.2<br>
639:
640: ^setdata[]
641: intersects:^if(^a.intersects[$b]){y;n}<br>
642: intersects2:^if(^a.intersects[ ]){y;n}<br>
643:
644:
645: <hr>
646:
647: @setdata[]
648: $a[$.1[a1] $.2[a2]]
649: $b[ $.2[b2] $.3[b3]]
650:
651:
652: @hash[]
653: $h[^hash::create[$._default[123]]]
654: $h.paf[not kretin]
655: $h.paf<br>
656: =$h.that=<br>
657:
658: @methresult[]
659: $result[^table::set{1}]
660:
661: @terror[]
662: ^error[method z must be called with z]
663:
664: @syntax1[]
665: #^a[^b]
666:
667: @syntax2[]
668: #^a[
669:
670: @ssave[]
671: $abc[abc]
672: ^abc.save[abc]
673:
674: @calendar[]
675: 2001;11:<br>
676: $week_days[^date:calendar[rus](2001;11)]
677: <pre>
678: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
679: </pre>
680:
681: @thash[]
682: $table[^table::set{id name age
683: 1 paf 278
684: 2 пиф 234
685: }]
686: $hash[^table.hash[id;^table::set[nameless]{id
687: name}]]
688: $hash.2.id $hash.2.name $hash.2.age
689:
690: @tdef[]
691: $s[0]
692: if 0=^if($s){}{n}<br>
693: if def 0=^if(def $s){y}{}<br>
694: <hr>
695:
696: @ford[]
697: ^for[i](0;5){$i}{($i)}
698:
699: @tif[]
700: ^if[def]{y;n}
701:
702: @image[]
703: $pict[^image::create(400;200)]
704: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
705: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
706: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
707: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
708: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
709: $response:body[^pict.gif[]]
710:
711:
712:
713: @mail2[]
714: ^mail:send[
715: $.content-type[$.value[text/plain] $.charset[windows-1251]]
716: $.from[Александр Петросян <paf@design.ru>]
717: $.to[Александр Петросян <paf@design.ru>]
718: $.subject[проверка]
719: $.body[проверка]
720: ]
721:
722: @cookie[]
723: $env:HTTP_COOKIE<br>
724:
725: #$cookie:переменная[test тест ТЕСТ2]
726: =$cookie:переменная=<br>
727: #$cookie:переменная2[test тест ТЕСТ3]
728: =$cookie:переменная2=<br>
729: =$cookie:CLASS.переменная2=<br>
730:
731: @response[]
732: #^if($form:reload){
733: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
1.1 paf 734: #}
1.6 paf 735:
736: @xslt[]
737: ^xdata[]
738: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
739: ^show_xdoc2[$transformed]
740:
741: @regexp2[]
742: $s[ select]
743: $s[^s.match[^^\s*][]{!}]
744: $s
745:
746: @header[]
747: $response:refresh[
748: $.value[0]
749: $.url[http://design.ru?a=^taint[123]]
750: ]
751:
752: @ttablerem[]
753: $table[^table::load[a.cfg]]
754: ^table.menu{$table.a}
755:
756: @tconnect[]
757: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
758: $tables[^table::sql{show tables}]
759: #$cols[^tables.columns[]]
760: #$cols.column
761: ^tables.menu{
762: $tables.[Tables_in_test]<br>
763: }
764: }
765:
766: @pcre[]
767: $s[1 2]
768: ^s.match[\s;ig]{!}
769: #^s.match[\d;ig]{!}
770:
771:
772: @regexp[]
773: $s[abcАБВ]
774: ^if(^s.match[б][i]){y}{n}
775:
776: @mail[]
777: #$ORIGINS(1)
778: ^mail:send[
779: $.from[paf@design.ru]
780: $.to[paf@design.ru]
781: $.body[1
782:
783: 2
784:
785:
786: 3]
787: ]
788:
789: @exec[]
790: $a[^file::exec[fc.exe;;a;b]]
791: $a.status|$a.stderr<hr>
792:
793: @fori[][i]
794: ^for[i](1;3){... =$i= ...}
795:
796: @xdata0[]
797: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
798: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
799: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
800: <people>
801: <man id="1" имя="word слово">
802: <name>P«^;AF B</name>
803: </man>
804: <man id="2">
805: <name>ПИФ^taint[&]</name>
806: </man>
807: </people>
808: }]
809:
810: @xdata[]
811: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
812: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
813: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
814: <people>
815: <man id="1" имя="word слово">
816: <name>P«^;AF B</name>
817: </man>
818: <man id="2">
819: <name>ПИФ^taint[&]</name>
820: </man>
821: </people>
822: }}]
823:
824: @xml[]
825: ^xdata[]
826:
827: ^show_xdoc2[$xdoc]<hr>
828: #^show_xnode1[$xdoc]<hr>
829: $people[^xdoc.select[*/man]]
830: #^show1[]
831: ^show_xnodes1[$people]<hr>
832: #^people.0.owner.hren[]
833:
834: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
835:
836: by id:
837: ^show_xnode1[^xdoc.getElementById[1];0;1]
838: <hr>
839:
840: @show1[array]
841: ^for[i](0;^array._count[]-1){
842: $x[$array.$i]
843: $x.firstChild.nodeValue:
844: $pattributes[$x.parentNode.attributes]
845: ^if(^pattributes._count[]){
846: $pattributes.id.name=$pattributes.id.nodeValue
847: }
848: <br>
849: }
850:
851: @show_xnodes1[array][i]
852: ^for[i](0;^array._count[]-1){
853: ^show_xnode1[$array.$i;0;1]
854: }
855:
856: @show_xnode1[x;level;single][l]
857: ^if(def $x){
858: ^for[l](0;$level-1){ ^; ^; ^; ^;}
859: ^if($x.nodeType == $xnode:ELEMENT_NODE){
860: <^;$x.nodeName
861: $pairs[$x.attributes]
862: ^if(def $pairs){
863: $names[^pairs._keys[]]
864: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
865: }
866: >^;
867: }{
868: [$x.nodeType]
869: }
870:
871: ^if(def $x.nodeValue){$x.nodeValue}<br>
872: ^show_xnode1[$x.firstChild]($level+1)
873: ^if(!$single){
874: ^show_xnode1[$x.nextSibling]($level)
875: }
876:
877: ^if($x.nodeType == $xnode:ELEMENT_NODE){
878: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
879: }
880: }
881:
882: @show_xdoc2[xdoc]
883: ^xdoc.save[out/save.xml;
884: # $.encoding[utf-8]
885: $.method[xml]
886: ]
887: $file[^xdoc.file[
888: $.encoding[utf-8]
889: $.method[html]
890: ]]
891: ^file.save[text;out/save_file.html]
892: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
893: <pre>^taint[html][^xdoc.string[
894: $.method[html]
895: # $.encoding[utF-8]
896: # $.omit-xml-declaration[yes]
897: # $.standalone[no]
898: # -$.doctype-public[-//W3C//DTD XHTML]
899: # -$.doctype-system[/a/b/c/]
900: # $.indent[yes]
901: # $.media-type[text/paf]
902: ]]
903: </pre>
E-mail: