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