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