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