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