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