Annotation of parser3/www/htdocs/index.html, revision 1.160
1.104 paf 1: @USE
1.105 paf 2: /derived.p
1.145 paf 3: /operators.p
1.15 paf 4:
1.72 paf 5: @auto[filespec]
6: $selffilespec[$filespec]
1.63 paf 7: #$form:here
1.131 paf 8: #$request:charset[UTF-8]
9: $request:charset[windows-1251]
10: $response:charset[windows-1251]
1.112 paf 11: #$response:charset[UTF-8]
1.131 paf 12: #$response:charset[empty]
1.84 paf 13: #$response:content-type[$.value[text/html]$.charset[$response:charset]]
1.15 paf 14:
1.60 paf 15: #@postprocess[body]
16: #<b>$body</b>
17: #$result[123]
1.37 paf 18:
1.15 paf 19: @main[]
1.72 paf 20: #$a(123)
21: #^a.format[%.10u]
1.71 paf 22: #$result[111]
1.70 paf 23: #^f[a]
1.133 paf 24: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
1.88 paf 25: # ^int:sql{select news_id from news where news_id=-1}[
1.143 paf 26: # $.default{2}
1.88 paf 27: # ]<br>
1.115 paf 28: # ^hash::sql{bad}
1.88 paf 29: # ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
1.109 paf 30: # ^file::load[text;^string:sql{select 'from sql server' }]
1.95 paf 31: # ^string:sql{select '^^hello[]' }] $ORIGINS(1)
1.96 paf 32: # ^process{ ^^h[]}
1.97 paf 33: # ^process{^string:sql{select '1
34: # ^^hello[]' }] }
1.131 paf 35: # ^double:sql{select '2*' ^; }
1.133 paf 36: #$card_sequence_expect_no(^double:sql{select 20020909131047 #card_sequence_expect_no from card_sequence})
37: #^card_sequence_expect_no.format[%15.f]
38: #}
1.49 paf 39: #^eval(2)
1.48 paf 40: #^tcrashlocaljunctionsv2[]
1.49 paf 41: #^tcrashlocaljunctions[]
1.50 paf 42: #^tjunctions[]
1.47 paf 43: #^replacetest[]
1.48 paf 44: #^matchoptionpp[]
1.46 paf 45: #^txdocxnodechild[]
1.44 paf 46: #^tclasses[]
1.43 paf 47: #$math:PI
48: #^b:method[]
1.42 paf 49: #^main[]
1.41 paf 50: #^errort[]
1.44 paf 51: #^tselectNumber[]
1.39 paf 52: #$result[hello]
1.36 paf 53: #^invaliddate2[]
54: #^process2[]
55: #^casehashtext[]
1.35 paf 56: #^subjvaltest[]
57: #^tableselect0[]
1.34 paf 58: #^memnotest1[]
1.32 paf 59: #^voidparams[]
1.31 paf 60: #^rolls2[]
1.30 paf 61: #^cacheexpireschanging[]
1.29 paf 62: #^cacheexpiresfixed[]
63: #^dateoffsets[]
64: #^exceptionTypes[]
1.28 paf 65: #^roll2[]
1.27 paf 66: #^rolls[]
1.25 paf 67: #^exceptions1[]
1.22 paf 68: #^locate_by_expr[]
1.18 paf 69: #^method_junction_params{...}
1.17 paf 70: #^verifyCookie[paf]
1.37 paf 71: #^execlangs[]
1.16 paf 72: #$t[^tobjeresult[]]$t.a
73: #^xmlprobs[]
1.15 paf 74: #^doubleprobs[]
75: #^math:random(-10)
76: #^divnamestop[]
77: #^arrayclone[]
78: #^operator_tricks[]
79: #^xoutputrusattr[]
80: #^xdocset1[]
81: #^regexp3[]
82: #^exec2[]
83: #^tlock[]
84: #^xmloutattrwithoutvalue[]
85: #^precisionProblem[]
86: #^xpath[]
87: #^ttablesetlang[]
88: #^ttime[]
89: #^tupper[]
90: #^treplace[]
91: #^xslt2[]
92: #^tcache2[]
93: #$ORIGINS(1)
94: #$t[^table::set{a b} ^table::set{c d}]
95: #^ttaintuntaint[]
96: #^tappend2[]
97: #^badvsnprintf[]
98: #^badoracequoting[]
99: #^badconstructors[]
100: #^xloadwrongtable[]
101: #^xsetwrongtable[]
102: #^if($form:test){y}{n}
103: #^tablecolumnerror[]
104: #^roll[]
105: #^tableset[]
106: #^math:PI.format{%.30f}
107: #^xchildren[]
108: #^thashforeach3[]
109: #^thashforeach2[]
110: #^thashforeach[]
111: #^thashdelete[]
112: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
113: #^tappend[]
114: #^sappend[]
115: #^eval(10\3)<br>
116: #^tform[]
117: #^formattest[]
118: #^filelist[]
119: #^connect[mysql://user:pass@host]{ }
120: #^безнадёжна_попытка_поправить_непоправимое[]
121: #^tcache[]
122: #^thashfileexp[]
123: #^tcounter[]
124: #^tablehash[]
125: #j^hashfile[]
126: #^formclass[]
127: #^hren[]
128: #^domedit[]
129: #^domxslt[]
130: #^lsplit2[]
131: #^faceesize[]
132: #^imageresize[]
133: #^ifassignhash[]
134: #^tintdefault[]
135: #$response:status[404]
136: #^ifpasshash[]
137: #^movedir[]
138: #^replace[]
139: #^set[]
140: #^hash[]<hr>
141: #$t[^methresult[]] ->$t
142: #^terror[]
143: #^ssave[]
144: #^thash[]
145: #^tdef[]
146: #^ford[]
147: #^tif[]
1.84 paf 148: #^image[]
1.15 paf 149: #^response[]
150: #^regexp2[]
151: #^ttablerem[]
152: #^pcre[]
153: #^regexp[]<hr>
154: #^mail[]
155: #^fori[]
156: #^tconnect[]
157: #^xslt[]
158: #^header[]
1.53 paf 159: #^tablehasht[]
1.54 paf 160: #^datecreatestring[]
1.56 paf 161: #^mssqltypes1[]
162: #^badthrows[]
1.57 paf 163: #^xmlspace[]
164: #^counter[main.counter]
165: #^xpath2[]
166: #^callindirect[]
167: #^junctionprob[]
1.59 paf 168: #^datecreatestring2[]
169: #^tstoredproc[]
170: #^tstoredproc2[]
171: #^forkeys[]
1.60 paf 172: #^pngsize[]
1.61 paf 173: #^checkList[]
1.63 paf 174: #^datetest[]
1.65 paf 175: #^tserge[]
1.69 paf 176: #^envt[]
1.67 paf 177: #^selectt[]
178: #^select2[]
179: #^selectSingle2[]
180: #^selectString2[]
181: #^selectNumber2[]
182: #^selectBool2[]
183: #^xdoccreate[]
184: #^xdoccreatetag[]
1.70 paf 185: #^xdocload[]
1.67 paf 186: #^xdocstring[]
187: #^xdocsave[]
1.68 paf 188: #^div[]
189: #^datecreatestring3[]
1.73 paf 190: #^tfilespec[]
1.77 paf 191: #^tcrypt[]
1.74 paf 192: #^cryptdocsample[]
1.78 paf 193: #^tnormalize[]
1.83 paf 194: #^xmltransformbyxdoc[]
1.81 paf 195: #^sergestrandef[]
1.83 paf 196: #^tstdin[]
197: #^tfind[]
1.86 paf 198: #^mimet[]
1.92 paf 199: #^joinlimit[]
1.89 paf 200: #^tableclonelimit[]
1.91 paf 201: #^transparams[]
202: #^sendtests[]
1.93 paf 203: #^wwrapperpass[]
1.95 paf 204: #^badpos[]
1.98 paf 205: #^processtest[]
206: #^mail3[]
1.100 paf 207: #^datesaving[]
1.101 paf 208: #^badconstructor[]
1.103 paf 209: #^calendar[]
1.104 paf 210: #^monthdays(8)
211: #^xdoctypetest[]
1.105 paf 212: #^xtabletest[]
1.117 paf 213: #^staticstest[]
1.108 paf 214: #^staticstest2[]
1.115 paf 215: #^rbodytest[]
216: #^cookie[]
1.116 paf 217: #^cookieexpirestest[]
1.119 paf 218: #^postest[]
1.120 paf 219: #^voidpostest[]
1.122 paf 220: #^badcolumntest[]
1.124 paf 221: #^delimiters[]
1.125 paf 222: #^новый-split[]
1.127 paf 223: #^грязные-cookie[]
224: #^html-почта[]
225: #^badswitchtest[]
1.128 paf 226: #^okswitchtest[]
1.131 paf 227: #^cgit[]
1.132 paf 228: #^ttransformsep[]
1.133 paf 229: #^calltest[]
1.134 paf 230: #^xpath3[]
1.139 paf 231: #^doubleliterals[]
232: #^newxor[]
1.135 paf 233: #^mail2[]
1.139 paf 234: #^exec[]
1.140 paf 235: #^passpost[]
1.141 paf 236: #^fordelim[]
1.143 paf 237: #^duplicatetable2hashkey[]
1.142 paf 238: #^duplicatehashsqlkey[]
1.145 paf 239: #^longlreplace[]
240: #^table2hash_onecolumn[]
1.146 paf 241: #^crossopvars[]
1.148 paf 242: #^three[]
1.149 paf 243: #^badLangAfterCatch[]
1.150 paf 244: #^zeroinstdin[]
1.151 paf 245: #^shifts[]
246: #^jspace[]
1.152 paf 247: #^user-foreach-test[]
248: #^hashselfmodification[]
249: #^emptyTransformResult[]
250: #^badxdoccreate[]
1.154 paf 251: #^if(-d "CVS"){y}{n}
1.155 paf 252: #^badjunctioncall[]
1.156 paf 253: #^russianindex[]
254: #^virtualtest[]
255: #^xml[]
256: #^mail4[]
1.157 paf 257: #^voidconstructorpass[]
1.160 ! paf 258: #^$form:CLASS.a=$form:CLASS.a<br>
! 259: #^cookie2[]
! 260: #^menudelim[]
1.158 paf 261: #^touchittest[]
1.160 ! paf 262: #^touchittest2[]
! 263: #^opauto[]
! 264: ^trycontextt[]
! 265:
! 266: @trycontextt[]
! 267: ^try{
! 268: ^trycontexttsub[]
! 269: }{
! 270: $exception.handled(0)
! 271: }
! 272:
! 273:
! 274: @trycontexttsub[]
! 275: ^bad[]
! 276:
! 277:
! 278: @opauto[]
! 279: ^reada[]
1.159 paf 280:
281:
1.157 paf 282: @rusage2[]
1.77 paf 283: <hr>
1.74 paf 284: OK
1.157 paf 285:
286: @rusage2[]
287: $s[$status:rusage]
288:
289: ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f]
290:
1.150 paf 291:
1.156 paf 292: @voidconstructorpass[]
293: $a[$form:a]
294: =^form:a.int(1)=
295: =^a.int(1)=
296:
297:
1.155 paf 298: @russianindex[]
299: #dir with files with russian-lang names
300: $where[dir]
301:
302: $dir[^file:list[$where;\.txt^$]]
303: ^dir.menu{
304: <a href=$where/^untaint[uri]{$dir.name}>$dir.name</a><br>
305: }
306:
1.154 paf 307: @badjunctioncall[]
308: ^badjunctioncallinside{code}
309:
310: @badjunctioncallinside[code]
1.155 paf 311: xx^code[]
1.152 paf 312:
313: @badxdoccreate[]
314: $xdoc[^xdoc::create[вася]]
315: #$xdoc[^xdoc::create{<?xml version="1.0" encoding="$request:charset"?><doc>вася</doc>}]
316:
317: ^xdoc.firstChild.setAttribute[name;значение]
318: ^xdoc.string[]
319:
320:
321: @emptyTransformResult[]
322: $input[^xdoc::create[docBad]]
323: $sheet[^xdoc::create{<?xml version="1.0"?>
324: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
325: <xsl:template match="doc">
326: output
327: </xsl:template>
328: </xsl:stylesheet>
329: }]
330: $output[^input.transform[$sheet]]
331: $response:body[^output.file[]]
332:
333: @hashselfmodification[]
334: $hash[
335: $.a[1]
336: $.b[2]
337: ]
338: ^hash.foreach[key;value]{
339: # $hash.c[1]
340: $hash.a[1]
341: }
342:
343: @touchittest[][i]
1.160 ! paf 344: $i[before]
! 345: ^touchit[]
! 346: $i
! 347:
! 348: @touchittest2[]
1.158 paf 349: $i[before]
1.152 paf 350: ^touchit[]
351: $i
352:
353:
354: @user-foreach-test[][key;value]
355: ^user-foreach[key;value]{$key=$value<br>}
356:
1.151 paf 357: @user-foreach[key;value;code]
358: ^for[i](1;10){
1.152 paf 359: $code.$key($i)
360: $code.$value($i*2)
1.151 paf 361: $code
362: }
363:
364: @jspace[]
365: $a(1)
366: ^jspace_call{^eval($a*2)}
367: #$a(2)
368: #$junction
369:
370: @jspace_call[param][a]
371: $a[unrelcfgdfgated]
372: $junction<br>
373: $junction.a(2)
374: $junction<br>
375:
1.150 paf 376: @shifts[]
377: ^eval(1<<3)<br>
378: ^eval(8>>2)<br>
1.151 paf 379: #^if(1=1){y;n}<br>
1.150 paf 380:
1.149 paf 381:
382: @zeroinstdin[]
383: #$f[^file::exec[a.pl;$.stdin[$.shit[]]]]
384: $f[^file::exec[a.pl;$.stdin[^file::load[binary;1z2.txt]]]]
385: =$f.text=
386: ^f.save[binary;1z2.out]
1.148 paf 387:
388: @badLangAfterCatch[]
389: ^try{
390: $a[
391: тут язык сменился на pass_appended
392: ^throw[user;test]
393: и улетело с не тем языком
394: ]
395: }{
396: $exception.handled(1)
397: }
398: 1 2
1.145 paf 399:
400: @crossopvars[]
401: #^one[]<hr>
402: ^two[]<hr>
403:
404: @table2hash_onecolumn[]
405: $t[^table::create{a
406: 1
407: 1
408: }]
409: #^t.hash[a]
410: #^t.hash[a;b]
411: $h[^t.hash[a][$.distinct(1)]]
412: $h.1.a
1.143 paf 413:
414: @longlreplace[]
1.144 paf 415: $str1[ мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла мыла ]
1.143 paf 416: $str2[ела]
417: $str[Мама $str1 раму]
418:
1.144 paf 419: ^str.replace[^table::create[nameless]{мыла $str2}]
1.141 paf 420:
421: @duplicatehashsqlkey[]
422: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
423: $t[^table::sql{select * from news}]
424: $c[^t.columns[]]
425: ^c.menu{$c.column}[,]
426:
1.142 paf 427: $h[^hash::sql{select news_type_id, name from news}[$.distinct(1)]]
1.141 paf 428: }
429:
430: @duplicatetable2hashkey[]
431: $t[^table::create{a b
432: 1 2
433: 1 3
434: }]
1.142 paf 435: #^t.hash[a]
436: #^t.hash[a;b]
437: ^t.hash[a][$.distinct[1]]
1.140 paf 438:
439: @menudelim[]
440: $t[^table::create{a
441: 1
442: 2
443: 3
444: 4
445: 5
446: }]
447:
448: ^t.menu{^if($t.a<3){}{$t.a}}[,]
449:
450: @fordelim[]
451: ^for[a](0;6){^if($a<3){}{$a}}[,]
452:
1.135 paf 453:
1.139 paf 454: @passpost[]
455: <form method=post name="test" id="test">
456: <textarea name="text" cols=20 rows =6>^taint[html][1
457: 2
458:
459: 3]</textarea><br>
460: <input type=submit>
461: </form>
462:
463: ^if(def $form:text){
464: $a[^file::cgi[a.pl]]
465: $a.text|$a.status|$a.stderr<hr>
466: }
467:
468: @exec[]
469: #$a[^file::exec[a.cmd]]
470: $a[^file::cgi[a.cmd]]
471: $a.text|$a.status|$a.stderr<hr>
472:
473:
1.137 paf 474: @newxor[]
1.138 paf 475: ^eval(1!|2 #примечание()zzz
476: |0x100)<br>
1.137 paf 477: #^eval(1!||2)<br>
478: ^if(1!|1){y}{n}
479:
480: #@method[$bad]
1.136 paf 481:
1.135 paf 482: @doubleliterals[]
483: #^eval(1e-10)
484: ^eval("1e-20")
1.133 paf 485:
486: @xpath3[]
487: $constr[^xdoc::create{<?xml version="1.0" encoding="$request:charset" standalone="no"?> <constructor-data><object object_type_id="1" template_id="1" data_process_id="1" is_published="1">проверка</object> <block-list> <block name="date" type="0" label="Дата" is_hide_pub="1" data_type="1"/> <block name="content" type="0" label="Текст" is_hide_pub="1" data_type=""/> </block-list></constructor-data>}]
488: $objectData[^constr.selectSingle[/constructor-data/object]]
489: $objectData.nodeType<br>
490: $objectData.firstChild.nodeValue
491:
492: @calltest[]
493: ^calltest2[string]
494:
495: @calltest2[s]
496: $s
1.131 paf 497:
498: @ttransformsep[]
499: $input[^xdoc::load[20020909131046.xml]]
500: $output[^input.transform[generated.xsl]]
501: ^output.string[]
1.127 paf 502:
503: @okswitchtest[]
504: $local[local value]
505: ^switch[1]{
506: ^case[1]{1code $local}
507: }
508:
509: @badswitchtest[]
510: ^switch[1]{
511: ^badswitchtestcase[]
512: }
513: @badswitchtestcase[][local]
514: $local[local value]
515: ^case[1]{1code $local}
516:
517: @badjunction[]
518: ^badj1[]
519: ^badj2[]
520:
521: @html-почта[]
522: $переменная[значение]
523: ^mail:send[
524: $.from[paf@mail]
525: $.to[paf@mail]
526: $.subject[htmltest1]
527: $.html{тест$переменная= !}
528: ]
529:
1.124 paf 530:
531: @грязные-cookie[]
1.126 paf 532: $cookie:a[&]
1.125 paf 533: $cookie:a
1.124 paf 534:
535: @новый-split[]
536: $abc[a.b.c]
537: #$table[^abc.split[.]]
538: #$table[^abc.split[.;l]]
539: #$table[^abc.split[.;v]]
540: $table[^abc.split[.;lv]]
541: ^table.menu{$table.piece}[,]
542: <hr>
543: #$table[^abc.split[.;h]]
544: $table[^abc.split[.;hr]]
545: $table.0,$table.1,$table.2<br>
1.123 paf 546:
547: @delimiters[]
548: $a#1[1]<br>
549: $a#1=<br>
550:
1.121 paf 551:
552: @badcolumntest[]
553: $table[^table::load[ext.cfg]]
554: $table.b
555:
1.120 paf 556:
557: @virtualtest[]
558: $derived[^derived::create[derived create actual param]]
559: ^derived.test[]
560:
1.119 paf 561:
562: @voidpostest[]
563: $s[]
564: ^s.pos[$nothing]
1.118 paf 565:
566: @postest[]
567: $s[$nothing]
568: ^s.pos[$nothing]
1.113 paf 569:
1.115 paf 570: @cookieexpirestest[]
571: #$cookie:exptest[1]
572: #$cookie:exptest[$.value[2] $.expires(+1)]
573: $response:xxxx[^date::now(+10)]
574: $response:yyy[$.value[^date::now(+20)]]
575: $response:yyy[$.value[vvv] $.aaaa[^date::now(+20)]]
576:
1.113 paf 577: @rbodytest[]
578: $request:body=
579: <form method=post>
580: <input type=submit name=paf value=123>
581: </form>
1.107 paf 582:
583: @staticstest2[]
584: ^$derived:derived_var=$derived:derived_var<br>
585: ^$derived:a=$derived:a<br>
1.108 paf 586: $derived:a[changed] ^$derived:a=$derived:a<br>
1.107 paf 587: $derived:derived_var[changed]
588: ^$derived:derived_var=$derived:derived_var<br>
589:
1.105 paf 590: @staticstest[]
591: $derived[^derived::create[]]
592: ^derived.test[]
1.110 paf 593: <hr>
1.106 paf 594: ^$derived.a=$derived.a<br>
595: ^$derived.x=$derived.x<br>
1.110 paf 596: <hr>
597: ^if($derived is derived){derived is derived}{error: derived is not derived}<br>
598: ^if($derived is table){derived is table}{error:derived is not table}<br>
1.111 paf 599: <hr>
600: ^^eval(^$derived)=^eval($derived)<br>
601: ^^if(^$derived)=^if($derived){y}{n}<br>
1.106 paf 602:
1.105 paf 603:
1.104 paf 604: @xdoctypetest[]
605: $xdoc[^xdoc::create[x]]
606: ^if($xdoc is xdoc){y}{n}
607:
608: @xtabletest[]
609: $xtableo[^xtable::create[]]
610: ^if($xtableo is table){y}{n}
1.105 paf 611: #^xtableo.columns[]
1.100 paf 612:
1.103 paf 613: @monthdays[month]
614: $from[^date::create(2000;$month;1)]
615: $to[^date::create($from)] ^to.roll[month](+1)
616: $result($to-$from)
617:
1.100 paf 618: @badconstructor[]
619: ^date::now[]
1.99 paf 620:
621: @datesaving[]
622: $now[^date::now[]]
623: $now.daylightsaving<br>
624: $now.yearday<br>
625: #
626: $date[^date::create(2002;1;3)]
627: $date.daylightsaving<br>
628: $date.yearday
1.97 paf 629:
1.98 paf 630: @mail4[]
631: ^mail:send[
632: $.from[paf@mail.design.ru]
633: $.to[paf@mail.design.ru]
1.156 paf 634: $.subject[^taint[uri][москва=E0_+ ]=2]
1.98 paf 635: $.text[^taint[uri][москва]=]
636: $.html{<a href=http://there.ru/?city=^taint[uri][Москва]>link</a>}
637: ]
1.97 paf 638: @processtest[]
639: $f[^file::load[text;piece.p]] ^process{$f.text}
640: $ORIGINS(1)
1.93 paf 641:
642:
643: @badpos[]
644: $s[123]
1.94 paf 645: ^s.mid(0;2)
1.92 paf 646:
647: @wwrapperpass[]
648: $h[^hash::create[]]
649: $h.a(1)
650: ^my_method[^if(1){$h}]
651: работает. так и должно быть?
652:
653: @my_method[p]
654: ^p._count[]
655:
1.88 paf 656:
657: @tableclonelimit[]
658: $source[^table::create{a
659: aa
660: bb
661: cc}]
662: ^source.offset(1)
663: #$dest[^table::create[$source]]
664: $dest[^table::create[$source;$.offset(2)]]
665: $dest[^table::create[$source;$.limit(2)]]
666: $dest[^table::create[$source;$.offset(1)$.limit(1)]]
667: $dest[^table::create[$source;$.offset(1)$.limit(2)]]
668: $dest[^table::create[$source;$.offset[cur]$.limit(2)]]
669:
670: ^dest.menu{$dest.a}[,]<br>
671:
672: @joinlimit[]
673: $source[^table::create{a
674: aa
675: bb
676: cc}]
677: ^source.offset(2)
678: $dest[^table::create{a
679: xx
680: }]
681: #^dest.join[$source]
682: #^dest.join[$source;$.offset(2)]
683: #^dest.join[$source;$.limit(2)]
684: #^dest.join[$source;$.offset(1)$.limit(1)]
685: #^dest.join[$source;$.offset(1)$.limit(2)]
1.91 paf 686: #^dest.join[$source;$.offset[cur]$.limit(1)]
687: ^dest.join[$source;$.limit(0)]
1.88 paf 688:
689: ^dest.menu{$dest.a}[,]<br>
1.86 paf 690:
691: @cgit[]
692: $f[^file::cgi[showenv.cmd]]
693: $f.HELLO=<br>
694: $f.CONTENT-TYPE=<br>
695: $f.content-type=<br>
696:
1.83 paf 697:
1.84 paf 698: @mimet[]
1.85 paf 699: $f[^file::stat[a.GIF]]
700: $f.content-type
1.84 paf 701:
702:
1.83 paf 703: @tfind[]
704: ^file:find[index.html]
705:
706: @tstdin[]
707: $f[^file::exec[test.pl;$.stdin[проверка stdin потока]]]
708: <pre>$f.text</pre>
1.80 paf 709:
710: @sergestrandef[]
711: $sQuantity[ ]
712: ^sQuantity.int(10)
1.78 paf 713:
714: @xmltransformbyxdoc[]
715: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
716: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
717: <people>
718: <man id="1" имя="word слово">
719: <name>1 2</name>
720: </man>
721: </people>
722: }}]
723: $sheet[^xdoc::create{<?xml version="1.0"?>
1.79 paf 724: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
725:
726: >
1.78 paf 727: <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
728:
1.79 paf 729: <!--<xsl:import href="http://localhost/html.xsl"/>-->
730: <xsl:import href="html.xsl"/>
731:
1.78 paf 732: <xsl:param name="param1">defparam1</xsl:param>
733: <xsl:param name="param2">defparam2</xsl:param>
1.79 paf 734:
1.78 paf 735:
736: <xsl:template match="doc">
737: param1=<xsl:value-of select="^$param1"/><br/>
738: param2=<xsl:value-of select="^$param2"/><br/>
739:
740: test return <something background=""/>
741: </xsl:template>
742:
743: <xsl:template name="test">
1.81 paf 744: test return3
1.78 paf 745: </xsl:template>
746:
747: <xsl:template match="people">
748: <html>
1.155 paf 749: <head>
750: <link type='text/xml' rel='alternate' href='/Default.vsdisco'/>
751: z</head>
1.78 paf 752: para1=<xsl:copy-of select="^$param1"/>
753: <xsl:apply-templates/>
754: <hr/>
755: <xsl:call-template name="test"/>
756: </html>
757: </xsl:template>
758:
759: <xsl:template match="name">
760: <b><xsl:value-of select="."/></b>
761: </xsl:template>
762: </xsl:stylesheet>
763: }]
764:
765:
766: $xdoc[^xdoc.transform[$sheet]]
767: $string[^xdoc.string[$.method[html]]]
768: ^string.save[a]
769: ^untaint[html]{$string}
770:
771:
1.77 paf 772:
773: @tnormalize[]
774: #s состоит из 1000 фрагментов
775: $s[^for[i](0;999){фрагмент }]
776: #это займет много ресурсов
777: ^s.match[фраг][g]{перга}
778: #это займет меньше ресурсов
779: #$normalized[^s.normalize[]]
780: #^normalized.match[фраг][g]{перга}
1.74 paf 781:
782: @sendtests[]
1.89 paf 783: ^text[]
1.74 paf 784: #^html[]
785: #^text-n-html[]
786: #^file[]
787: #^text-n-file[]
1.89 paf 788: #^text-n-html-n-file[]
1.74 paf 789: #^backwardcomp[]
790:
791: @backwardcomp[]
792: ^mail:send[
793: $.from[paf]
794: $.to[paf]
795: $.body[this is text value]
796: ]
797:
798: @text[]
799: ^mail:send[
800: $.from[paf]
1.90 paf 801: $.to[paf]
1.74 paf 802: $.text[
803: $.value[this is text value]
804: ]
805: ]
806:
807: @html[]
808: ^mail:send[
809: $.from[paf]
810: $.to[paf]
811: $.html{this is <b>html</b> value ^taint[<] 10}
812: ]
813:
814: @text-n-html[]
815: ^mail:send[
816: $.from[paf]
817: $.to[paf]
818: $.text[
819: $.value[this is text value]
820: ]
821: $.html[
822: $.value{this is <b>html</b> value ^taint[<] 10}
823: ]
824: ]
825:
826: @file[]
827: ^mail:send[
828: $.from[paf]
829: $.to[paf]
830: $.file[^file::load[binary;image.jpg]]
831: ]
832:
833: @text-n-file[]
834: ^mail:send[
835: $.from[paf]
836: $.to[paf]
837: $.text[
838: $.value[this is text value]
839: ]
840: $.file[^file::load[binary;image.jpg]]
841: ]
842:
843: @text-n-html-n-file[]
844: ^mail:send[
845: $.from[paf]
846: $.to[paf]
847: $.text[
848: $.value[this is text value]
849: ]
850: $.html[
851: $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
852: $.value{this is <b>html</b> value ^taint[<] 10}
853: ]
854: $.file[^file::load[binary;image.jpg]]
855: ]
856:
857:
858:
859: @md5salt[]
860: 1234
861:
862: @cryptdocsample[]
863: $users[^table::create{name password
864: alice ***
865: bob ***
866: }]
867:
868: $htpasswd[^table::create[nameless]{}]
869: ^users.menu{
870: ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
871: }
872:
873: ^htpasswd.save[nameless;.htpasswd-parser-test]
874:
1.73 paf 875:
876: @tcrypt[]
1.76 paf 877: #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
878: ^math:crypt[123;^$apr1^$]<br>
1.72 paf 879:
880: @tfilespec[]
881: src=$selffilespec<br>
882: dirname=^file:dirname[$selffilespec]<br>
883: basename=^file:basename[$selffilespec]<br>
884: justname=^file:justname[$selffilespec]<br>
885: justext=^file:justext[$selffilespec]<br>
1.68 paf 886:
887: @datecreatestring3[]
888: $new_after[^date::now(-3)]
889: $articles[^table::create{id title last_update
890: 1 привет 2002-07-03}]
891: ^articles.menu{
892: $last_update[^date::create[$articles.last_update]]
893: <a href=${articles.id}.html>$articles.title</a>
894: ^if($last_update > $new_after){новая}
895: <br>
896: }
1.67 paf 897:
898: @div[]
899: $var(5)
900: ^var.inc(7)
901: ^var.dec(3)
902: ^var.div(4)
903: ^var.mul(2)
904: $var
905:
906:
907: @xdocsave[]
908: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
909: <document>
910: строка1<br/>
911: строка2<br/>
912: </document>}]
913: ^document.save[test.xml]
914:
915: @xdocstring[]
916: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
917: <document>
918: строка1<br/>
919: строка2<br/>
920: </document>}]
921: ^document.string[
922: $.method[html]
923: ]
924:
925:
926: @xdocload[]
927: $document[^xdoc::load[article.xml]]
928: $response:body[^document.file[$.media-type[text/xml]]]
929:
930:
931: @xdoccreatetag[]
932: $document[^xdoc::create[document]]
933: $paraNode[^document.createElement[para]]
934: $dummy[^document.documentElement.appendChild[$paraNode]]
935: $response:body[^document.file[$.media-type[text/xml]]]
936:
937:
938: @xdoccreate[]
939: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
940: <document>
941: текст
942: </document>}]
943: $response:body[^document.file[$.media-type[text/xml]]]
944:
945: @selectBool2[]
946: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
947: <t attr="привет" n="123"/>}]
948: ^if(^d.selectBool[/t/@n > 10]){
949: /t/@n больше 10
950: }{
951: не больше
952: }
953:
954:
955: @selectNumber2[]
956: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
957: <t attr="привет" n="123"/>}]
958: ^d.selectNumber[number(/t/@n)+1]<br>
959: ^d.selectNumber[2*2]<br>
960:
961:
962: @selectString2[]
963: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
964: <t attr="привет" n="123"/>}]
965: # результат=привет
966: ^d.selectString[string(t/@attr)]
967:
968:
969: @selectSingle2[]
970: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
971: <t attr="привет" n="123"/>}]
972: # результат=один элемент "t"
973: $element[^d.selectSingle[t]]
974: # результат=2 (количество атрибутов <t>)
975: Количество атрибутов: ^element.attributes._count[]<br>
976: # результат=не существует (нет <x>)
977: ^if(^d.select[x]){
978: x существует
979: }{
980: x не существует
981: }
982:
983: @select2[]
984: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
985: # результат: список из одного элемента "t"
986: $list[^d.select[t]]
987: # результат: 2 = количество атрибутов <t>
988: ^list.0.attributes._count[]<br>
989: ^for[i](0;$list-1){
990: $attr[$list.$i]
991: $attr.nodeName = $attr.nodeType<br>
992: }
993:
994:
995: @selectt[]
996: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
997: $list[^d.select[t]]
998: ^list.0.attributes._count[]
1.65 paf 999:
1000: @envt[]
1.66 paf 1001: $f[^file::exec[showenv.cmd;
1002: $.bad[value]
1003: $.CGI_good[value]
1004: ]]
1.65 paf 1005: $f.status<br>
1006: $f.stderr<br>
1007: <pre>$f.text</pre>
1008:
1.63 paf 1009:
1010: @tserge[]
1.64 paf 1011: ^if(" 09 "){y}
1.61 paf 1012:
1013: @datetest[]
1014: $f[^file::stat[some.zip]]
1015: Размер в байтах: $f.size<br>
1016: Год создания: $f.cdate.year<br>
1017: $now[^date::now[]]
1018: $DAYS_CONSIDERED_NEW(3)
1019: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
1020:
1.60 paf 1021:
1022: @checkList[]
1023: ...^oneOf[a;a,b,c]...<br>
1024: #...^oneOf[a;ax,b,c]...<br>
1025: ...^oneWord[word]...<br>
1026: #...^oneWord[wo rd]...<br>
1027:
1028:
1029: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
1030: $t[^list.lsplit[,]]
1031: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
1032: $result[$s]
1033:
1034: @oneWord[s]
1035: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59 paf 1036:
1037: @pngsize[]
1038: $i[^image::measure[test.png]]
1039: ^i.html[]
1040:
1041:
1042: @forkeys[]
1043: $text[^form:fields.foreach[key;val]{$key=$val
1044: }]
1045: ^text.save[ttt.txt]
1046: =$text=
1047:
1048:
1049: @tstoredproc2[]
1050: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1051: ^void:sql{exec pafvoid}
1052: }
1053:
1054: @tstoredproc[]
1055: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1056: $t[^table::sql{exec pafproc}]
1057: # $t[^table::sql{{call pafproc}}]
1058: $c[^t.columns[]]
1059: ^c.menu{$c.column}[<br>]
1060: }
1.57 paf 1061:
1062: @datecreatestring2[]
1.58 paf 1063: <table border=1>
1064: ^datecreatestring2show[2000]
1065: ^datecreatestring2show[2000-02]
1.59 paf 1066: ^datecreatestring2show[2000-2-03]
1.58 paf 1067: ^datecreatestring2show[2000-02-03 15]
1068: ^datecreatestring2show[2000-02-03 15:30]
1069: ^datecreatestring2show[2000-02-03 15:30:04]
1070: ^datecreatestring2show[2000-02-03 15:30:04 hren]
1071: ^datecreatestring2show[15:30]
1072: ^datecreatestring2show[15:30:05]
1073: ^datecreatestring2show[15:30:05 hren]
1074: </table>
1075:
1076: @datecreatestring2show[s]
1077: $date[^date::create[$s]]
1078: <tr>
1079: <td>$s</td><td align=right>^date.sql-string[]</td>
1080: </tr>
1081:
1.57 paf 1082:
1083: @junctionprob[][l]
1084: $l[123]
1085: $a{$l}
1086: ^junctionprobnested[$a]
1087: @junctionprobnested[p]
1088: $p
1089:
1090:
1091: @callindirecttarget[]
1092: callindirecttarget called
1093: @callindirect[]
1094: $f[$callindirecttarget]
1095: ^f[]
1096:
1097: @xpath2[]
1098: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
1099: <doc>
1100: <field-list>
1101: <field name="aa"/>
1102: <field name="bb"/>
1103: </field-list>
1104: </doc>
1105: }]
1106:
1107: #^xdoc.string[]
1108:
1109: $fieldList[^xdoc.selectSingle[/doc/field-list]]
1110: #^fieldList.childNodes._count[]
1111: $fields[^fieldList.select[field]]
1112: #^fields._count[]
1113: ^fields.foreach[k;node]{
1114: $node.nodeName<br>
1115: }
1116: @counter[filespec][f;s]
1117: ^file:lock[$filespec]{
1118: $f[^file::load[text;$filespec]]
1119: $s[^eval($f.text+1)]
1120: ^s.save[$filespec]
1121: }
1122: $s
1.56 paf 1123:
1124: @xmlspace[]
1125: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
1126: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
1127: <people>
1128: <man id="1" имя="word слово">
1129: <name>1 2</name>
1130: </man>
1131: </people>
1132: }}]
1133: $xdoc[^xdoc.transform[global.xsl]]
1134: $string[^xdoc.string[$.method[html]]]
1135: ^string.save[a]
1136: ^untaint[html]{$string}
1137:
1138: @badthrows[]
1139: #^throw[a;b;]
1140: ^throw[a;]
1.54 paf 1141:
1142: @mssqltypes1[]
1143: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55 paf 1144: # ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
1145: # ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
1146: # ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
1147: $t[^table::sql{select a from paf}]
1148: ^t.count[]
1.54 paf 1149: }
1.51 paf 1150:
1.53 paf 1151: @datecreatestring[]
1.54 paf 1152: $d[^date::create[2002-04-33 01:03:04]]
1.53 paf 1153: ^d.sql-string[]
1.52 paf 1154:
1155: @method[hash]
1156: $hash.key
1157: @mainZ[]
1158: ^method[
1159: $.key{code}
1160: ]
1161:
1.51 paf 1162: @tablehasht[]
1163: $t[^table::create{p
1164: 1
1165: 3
1166: 2
1167: 4}]
1168:
1169: $h[^t.hash[p]]
1170:
1171: =^h._count[]=
1172:
1173:
1174: @sqldefaults[]
1175: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
1176: ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
1177: ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
1178: }
1.60 paf 1179: =======
1180: <hr>
1181: OK
1182: >>>>>>> 1.50
1.48 paf 1183:
1184: @tcrashlocaljunctionsv2[]
1185: $a[
1186: $b{ $c[1] }
1187: ]
1188: $b
1189: $c
1190:
1191: @tcrashlocaljunctions[]
1192: $var[aaa]
1193: ^if(1){
1194: ^tcrashlocaljunctions1[]
1195: }
1196:
1197: $j
1198:
1.49 paf 1199: @tcrashlocaljunctions1[][var]
1200: $var[varvalue]
1.48 paf 1201: $j{
1202: $var
1203: }
1.49 paf 1204: $j
1.48 paf 1205:
1206: @tjunctions[][tl]
1207: $t[^t::create[]]
1208: ^tjunctionsi[]
1209:
1210: @tjunctionsi[][tl]
1211: $tl[12345]
1212: ^t.tjunctionsm[
1213: $.key{
1214: $tl
1215: }
1216: ]
1.46 paf 1217:
1.47 paf 1218: @replacetest[]
1219: $b[b]
1220: $s[
1221: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1222: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1223: ]
1224: ^s.replace[^table::create{from to
1225: ba !_}]
1226:
1227:
1.46 paf 1228: @matchoptionpp[]
1.47 paf 1229: #$ORIGINS(1)
1.46 paf 1230: $s[
1231: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47 paf 1232: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1233: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1234: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1235: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1236: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1237: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1238: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1239: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1240: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46 paf 1241: ]
1242: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
1243:
1.44 paf 1244:
1245: @txdocxnodechild[]
1246: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
1247: $xdoc.nodeName
1248: ^xdoc.selectNumber[2*2]
1.45 paf 1249: $xdoc:ELEMENT_NODE
1.44 paf 1250:
1251:
1252: @tclasses[]
1253: $t[^t::create[]]
1254: ^t.method[]
1255: <hr>
1256: ^t.base_method[]
1257:
1.40 paf 1258:
1259: @errort[]
1.42 paf 1260: ^xdoc::create[a]
1.40 paf 1261: #^throw[user;here;this]
1262:
1263: @tselectNumber[]
1264: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
1265: ^d.selectString[string(d/@attr)]<br>
1266: ^d.selectNumber[2*2]<br>
1267: ^d.selectNumber[number(/d/@n)+1]<br>
1268:
1.34 paf 1269:
1.36 paf 1270: @invaliddate2[]
1271: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
1272:
1273: @process2[]
1274: ^^process{
1275: ^process{
1276: ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
1277: }
1278: }
1279:
1.35 paf 1280: @casehashtext[]
1281: $tt[1]
1282: $tmp[
1283: ^switch[$tt]{
1284: ^case[1]{
1285: $.aaa[123]
1286: }
1287: ^case[DEFAULT]{
1288: $.bbb[456]
1289: }
1290: }
1.36 paf 1291: shit!
1.35 paf 1292: ]
1.36 paf 1293: #$tmp
1.35 paf 1294: $tmp.aaa
1295:
1296: @subjvaltest[]
1297: $a12[val]
1298: $b[12]
1299: $a$b
1300:
1.34 paf 1301: @tableselect0[]
1302: $person[^table::create{name height
1303: paf 1.77
1304: шохин 2.07
1305: moko 1.77
1306: }]
1307: $nottoohigh[^person.select($person.height<2)]
1308: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32 paf 1309:
1310: @transparams[]
1311: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
1312: $odoc[^idoc.transform[global.xsl;
1313: $.param1['1']
1314: $.param2['2']
1315: ]]
1316: <pre>^taint[^odoc.string[$.method[html]]]
1317:
1318: @memnotest1[]
1319: ^for[i](0;4000){
1320:
1321: $xxxx[$i]
1322: $xxxx
1323:
1324: }
1325:
1326: @memnotest1notes[]
1327: одна итерация цикла:
1328: [Mon Apr 8 20:12:02 2002] execution-------------------------|
1.35 paf 1329: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32 paf 1330: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1331: [Mon Apr 8 20:12:02 2002] "|| "
1332: [Mon Apr 8 20:12:02 2002] 12:WITH_ROOT
1333: [Mon Apr 8 20:12:02 2002] 13:VALUE
1334: [Mon Apr 8 20:12:02 2002] "xxxx" string
1.35 paf 1335: [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 1336: [Mon Apr 8 20:12:02 2002] 16:WITH_READ
1337: [Mon Apr 8 20:12:02 2002] 17:VALUE
1338: [Mon Apr 8 20:12:02 2002] "i" string
1339: [Mon Apr 8 20:12:02 2002] 18:GET_ELEMENT
1.35 paf 1340: [Mon Apr 8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
1341: [Mon Apr 8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32 paf 1342: [Mon Apr 8 20:12:02 2002] 15:CONSTRUCT_VALUE
1343: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1344: [Mon Apr 8 20:12:02 2002] "| "
1345: [Mon Apr 8 20:12:02 2002] 12:WITH_READ
1346: [Mon Apr 8 20:12:02 2002] 13:VALUE
1347: [Mon Apr 8 20:12:02 2002] "xxxx" string
1348: [Mon Apr 8 20:12:02 2002] 14:GET_ELEMENT
1349: [Mon Apr 8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
1350: [Mon Apr 8 20:12:02 2002] 12:STRING__WRITE
1.35 paf 1351: [Mon Apr 8 20:12:02 2002] "||"'469617+=24 VString -> 0 !optimize[6]'
1.32 paf 1352: [Mon Apr 8 20:12:02 2002] <-ja returned
1353: [Mon Apr 8 20:12:02 2002] ja->
1354:
1355: 201/328=0.612804878049 %%optimized
1356:
1357: 1.
1358: CREATE_*POOL
1359: сделать
1360: *POOL_POOLED+CODE
1361: где
1362: wwrapper
1363: и(возможно) wcodeframe
1364: +string
1365: стековая переменная
1366:
1367: 2.
1368: избавиться от обёртки при возврате результата process [см. тело _for]
1369:
1370: 3.
1371: сделать callback для process, чтобы вынести invariants из _for & co.
1372:
1373: 4.
1374: @todo склеить get_element и write_value (при вставлении? write_value)
1375:
1376: 5.
1377: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
1378: обёртка сразу выбрасывается = не нужна]
1379:
1380: 6.
1381: process вариант получить именно string, без VString обёртки [часто обёртка
1382: сразу выбрасывается = не нужна]
1383:
1384: 7.
1385: string head, убить 8 байт неправильной link
1.31 paf 1386:
1387: @voidparams[]
1388: ^voidparamsm[$form:field]
1389:
1390: @voidparamsm[p]
1391: ^p.int(123)
1.29 paf 1392:
1.30 paf 1393: @rolls2[]
1394: $now[^date::now[]]
1395: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
1396: ^for[i](1;12){
1397: ^d.roll[month](-1) ^d.sql-string[]<br>
1398: }
1399:
1.29 paf 1400: @cacheexpireschanging[]
1401: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
1402: ^cache[^date::now(+4/24/60/60)]
1403: # ^cache(2)
1.30 paf 1404: # ^cache(0)
1.29 paf 1405: ^math:random(100)
1406: }
1407:
1408:
1409:
1410: @cacheexpiresfixed[]
1411: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
1412: ^math:random(100)
1413: }
1414:
1415: @dateoffsets[]
1416: $d[^date::create(^date::now[]+1/24/60)]
1417: #$d[^date::now(+1/24/60)]
1418: ^d.sql-string[]
1419: #$d
1.26 paf 1420:
1.28 paf 1421: @exceptionTypes[]
1422: # parser.compile ^test[} компиляция (непарная скобка, ...)
1423: # parser.runtime ^if(0). параметры (больше/меньше, чем нужно, не тех типов, ...)
1424: # number.zerodivision ^eval(1/0) ^eval(1%0)
1425: # number.format ^eval(abc*5)
1426: # file.missing ^file:delete[delme] not found
1427: # file.access ^table::load[.] no rights
1428: # image.format ^image::measure[index.html] not gif/jpg
1429: # sql.connect ^connect[mysql://baduser:pass@host/db]{} not found/timeout
1430: # sql.execute ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}} syntax error
1431: # xml ^xdoc::create{<forgot?>} any error in xml/xslt libs
1432: # smtp.connect not found/timeout
1433: # smtp.execute communication error
1434:
1.26 paf 1435: @roll2[]
1436: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27 paf 1437: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26 paf 1438:
1.25 paf 1439:
1440: @rolls[]
1441: $d[^date::create(2002;4;4)]
1442: ^d.sql-string[]<br>
1443: ^for[i](1;7){
1444: ^d.roll[day](-1)
1445: ^d.sql-string[]<br>
1446: }
1447: <hr>
1448: $d[^date::create(2002;3;28)]
1449: ^d.sql-string[]<br>
1450: ^for[i](1;7){
1451: ^d.roll[day](+1)
1452: ^d.sql-string[]<br>
1453: }
1454: <hr>
1455: $d[^date::create(2002;12;3)]
1456: ^d.sql-string[]<br>
1457: ^for[i](1;14){
1458: ^d.roll[day](-1)
1459: ^d.sql-string[]<br>
1460: }
1461: <hr>
1462: $d[^date::create(2002;10;19)]
1463: ^d.sql-string[]<br>
1464: ^for[i](1;14){
1465: ^d.roll[day](+1)
1466: ^d.sql-string[]<br>
1467: }
1468:
1469:
1470:
1471:
1472:
1.22 paf 1473:
1474: @exceptions1[]
1475: ^try{
1476: aaa
1.24 paf 1477: ^throw[custom1;paf;is stupid]
1.22 paf 1478: }{
1.24 paf 1479: ^if($exception.type eq custom1){
1.28 paf 1480: # $exception.handled(1)
1481: ^throw[$exception]
1.24 paf 1482: type=$exception.type<br>
1483: source=$exception.source<br>
1484: file=$exception.file<br>
1485: lineno=$exception.lineno<br>
1486: comment=$exception.comment<br>
1487: }
1.22 paf 1488: }
1.21 paf 1489:
1490: @locate_by_expr[]
1491: $t[^table::create{a b
1492: 1 nok
1493: 2 ok
1494: 3 nok
1495: }]
1496: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17 paf 1497:
1498: @method_junction_params[param]
1499: ^if($param is junction){junction}{ne junction}
1500:
1501: @verifyCookie[value]
1502: ^if($cookie:dummyvote eq $value){
1503: $result(1)
1504: }{
1505: $cookie:dummyvote[$value]
1506: $result(0)
1507: }
1.16 paf 1508:
1509: @execlangs[]
1.20 paf 1510: $f[^file::exec[test.pl]]
1.36 paf 1511: err:$f.stderr<br>
1.16 paf 1512: ^process{$f.text}
1513: #$c[^t.columns[]]
1514: #^c.menu{
1515: #* $c.column<br>
1516: #}
1.36 paf 1517: c:$t.c<br>
1.16 paf 1518:
1519: @tobjeresult[]
1520: ^table::create{a
1521: 12}
1.15 paf 1522:
1523: @xmlprobs[]
1524: $xmlDataType[^xdoc::load[program.xml]]
1525: #<pre>^taint[^xmlDataType.string[]]
1526: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
1527: #=^xmlDataTypes._count[]=
1528: =^xmlDataTypes.0.getAttribute[type-id]=
1529:
1530: @doubleprobs[]
1531: $1(^math:radians(180))
1532: $2($math:PI)
1533: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
1534: ^if($1==$2){y;n}
1535: ^if(^math:radians(180)==$math:PI){y;n}
1536:
1537:
1538: @divnamestop[]
1539: $a(10)
1540: ^eval($a\3)
1541:
1542: @arrayclone[]
1543: $t[^table::create{a b
1544: 1 11
1545: 2 22
1546: }]
1547: $c[^table::create[$t]]
1548: ^c.append{2 33}
1549: ^t.count[]
1550: ^c.count[]
1551:
1552: @operator_tricks[]
1553: ^if(1){$a[^t[]]}
1554: $a!
1555: $a($b)
1556: ^if(1){y}{n}
1557: $MAIN:a(^t[] eq OK)
1558: #$MAIN:a(1)
1559: ^if($a){y}{n}
1560: #^if(1){y}{n}
1561: $form:if
1562: $a[$.n[1]]
1563: $a.if
1564:
1565: @xoutputrusattr[]
1566: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
1567: ^show_xdoc2[$d]
1568:
1569: @xdocset1[]
1570: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
1571: ^show_xdoc2[$d]
1572:
1573: @regexp3[]
1574: $s[abcАБВ]
1575: ^if(^s.match[][i]){y}{n}
1576:
1577:
1578: @exec2[]
1579: $a[^file::exec[bin/t.cmd]]
1580: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
1581:
1582:
1583: @tlock[]
1584: ^file:lock[lockfile]{
1585: code
1586: }
1587:
1588: @xmloutattrwithoutvalue[]
1589: #$ORIGINS(1)
1590: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
1591: $doc[^doc.transform[global.xsl]]
1592: =^taint[html][^doc.string[$.method[html]]]=
1593:
1594:
1595:
1596: @precisionProblem[]
1597: $a[123456789012345678901234567890]
1598: $b(^a.double[])
1599: ^b.format{%.20E}
1600: <hr>
1601: ^eval(2*2)
1602:
1603: @xpath[]
1604: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1605: <document><block><p>привет</p></block></document>
1606: }]
1607: #^show_xdoc2[$xdoc]
1608: $node[^xdoc.selectSingle[/document/block/p]]
1609: ^if(def $node){
1610: ^if($node is string){
1611: $node
1612: }{
1613: ^if($node is hash){
1614: ^node._count[]
1615: }{
1616: $node.nodeType
1617: }
1618: }
1619: #$node.firstChild.nodeValue
1620: }{
1621: node not found
1622: }
1623:
1624:
1625: @ttablesetlang[]
1626: $a-tab-b[a b
1627: 1 2]
1628:
1629: $t[^table::set{$a-tab-b}]
1630: =$t.a=
1631: <hr>
1632:
1633: $t[^table::set[nameless]{^taint[$a-tab-b]}]
1634: =$t.0=
1635: <hr>
1636:
1637: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
1638: =$t.a=
1639:
1640: #^t.append{1 2}
1641:
1642: @mail3[]
1643: ^mail:send[
1.98 paf 1644: $.from[Александр Петросян <paf@mail.design.ru>]
1645: $.to[Александр Петросян <paf@mail.design.ru>]
1646: $.subject[проверка2]
1.15 paf 1647: $.body[
1648: $.text[
1649: $.content-type[$.value[text/plain] $.charset[windows-1251]]
1.98 paf 1650: $.body[проверка^taint[uri][москва]=]
1.15 paf 1651: ]
1652: $.attachment[
1653: $.value[^file::load[text;index.html]]
1654: $.file-name[привет всем.html]
1655: ]
1656: ]
1657: ]
1658:
1659:
1660: @ttime[]
1661: $now[^date::now[]]
1662: $now.hour:$now.minute
1663:
1664: @tupper[]
1665: $t[abcABCабвАБВ]
1666: $t<br>
1667: ^t.upper[]
1668:
1669: @treplace[]
1670: $copy-paste-clean[^table::set{a b
1671: . _
1672: , _
1673: + _
1674: & _
1675: ? _
1676: = _}]
1677:
1678: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
1679: # почему-то этот replace роняет апач в 500 ошибку :(
1680: #^cache_key.replace[$copy-paste-clean]
1681: $test[abc]
1682: ^test.save[$cache_key]saved<br>
1683: $cache[^file:list[.;\.cache^$]]
1684: ^file:delete[$cache_key]deleted($cache.name)<br>
1685:
1686:
1687:
1688: @xslt2[]
1689: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1690: <document><block><p>привет</p></block></document>
1691: }]
1692: ^show_xdoc2[$xdoc]
1693: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
1694: <hr>
1695:
1696:
1697: @tcache2[]
1698: ^cache[$DB_HOME/keyключ](2){
1699: ^math:random(100)
1700: }
1701:
1702: @ttaintuntaint[]
1703: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
1704:
1705: ]zz
1706: <hr>
1707: ^untaint[html]{1^taint[ ]2 3}
1708:
1709:
1710: @tappend2[]
1711: $t[^table::set{a b}]^t.append{1 2}$t.a
1712:
1713: @badvsnprintf[]
1714: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
1715: }
1716:
1717:
1718: @badoracequoting[]
1719: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
1720: ^connect[$SQL.connect-string]{
1721: ^void:sql{delete from paf}
1722: ^void:sql{insert into paf values (1, '$form:text')}
1723: $paf[^table::sql{select * from paf}]
1724: ^paf.menu{
1725: $paf.id: ^untaint{$paf.block}<hr>
1726:
1727: }
1728: <hr>
1729:
1730:
1731: ^rem{
1732: $news[^table::sql{select description from news}[$.limit(3)]]
1733: ^news.menu{
1734: ^untaint{$news.description}<hr>
1735:
1736: }
1737: <hr>
1738: }
1739:
1740: $tables[^table::sql{select table_name from user_tables}]
1741: ^tables.menu{
1742: $tables.table_name<br>
1743: }
1744:
1745: }
1746: <hr>
1747: $env:PATH
1748:
1749: @badconstructors[]
1750: $bred[^string::length[]]
1751: $bred[^response::clear[]]
1752: $bred[^int::int[]]
1753:
1754:
1755: @xloadwrongtable[]
1756: $constr[^xdoc::load[wrongtable.xml]]
1757: ^show_xdoc2[$constr]
1758:
1759: @xsetwrongtable[]
1760: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
1761: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1762:
1763:
1764: @tablecolumnerror[]
1765: $t[^table::set{a}]
1766: $t.$a
1767:
1768: @roll[]
1769: #$date[^date::set(1970;1;2)]
1770: #^date.roll[month](-1)
1771: $date[^date::set(2038;1;1)]
1772: ^date.roll[month](+1)
1773: $date.year $date.month $date.day
1774:
1775: @cookie2[]
1776: #=$cookie:clientType[$.value[test]]=<br>
1.159 paf 1777: =$cookie:CLASS.clientType=<br>
1.15 paf 1778:
1779:
1780: @tableset[]
1781: $a[^table::set{a
1782: 1
1783: 2}]
1784: ^eval(100\$a)
1785:
1786:
1787:
1788: @zzz[]
1789:
1790:
1791: $constructor[
1792: <block1 name="main_srvr" type="0" label="Основное тело" />
1793: <block2 name="main_srvr2" type="0" label="Основное тело" />
1794: ]
1795:
1796: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
1797: <block-list>^untaint[as-is]{$constructor}</block-list>}]
1798:
1799: $children[$constr.documentElement.childNodes]
1800: ^if($children){
1801: ^for[i](1;^children._count[]){
1802: $node[$children.$i]
1803: $node.nodeName<br>
1804: }
1805: }
1806:
1807:
1808: @thashforeach3[]
1809: $h[
1810: $.a[1]
1811: $.b[2]
1812: ]
1813: $c[^table::set{a
1814: ^h.foreach[key;value]{$value
1815: }}]
1816: $c.a
1817:
1818: @thashforeach2[]
1819: $h[
1820: $.a[1]
1821: $.b[2]
1822: ]
1823: $c[
1824: ^h.foreach[key;value]{
1825: $.$key[$value]
1826: }
1827: ]
1828: $c.b
1829:
1830: @thashforeach[]
1831: $h[
1832: $.a[1]
1833: $.b[2]
1834: ]
1835: ^h.foreach[key;value]{
1836: $key=$value<br>
1837: }
1838:
1839: @thashdelete[]
1840: $h[$.a[1] $.b[2]]
1841: was:<br>
1842: count=^h._count[] <br>
1843: b='$h.b' <br>
1844:
1845: ^h.delete[b]
1846:
1847: now:<br>
1848: count=^h._count[] <br>
1849: b='$h.b'
1850:
1851: @sappend[]
1852: $test[123]
1853: ^test.save[test]
1854: ^test.save[append;test]
1855:
1856: @tappend[]
1857: $test[^table::set{a b
1858: a1 b1}]
1859: ^test.save[test]
1860: $test[^table::set{a b
1861: a2 b2}]
1862: ^test.save[append;test]
1863:
1864:
1865: @tform[]
1866: ^if(def $form:new_file){y}{n}
1867: <form method="post" enctype="multipart/form-data">
1868: <input type="file" name="new_file" />
1869: <input type=submit>
1870: </input>
1871:
1872: @formattest[]
1873: $size(15.124)
1874:
1875: ^size.format{%.2f}
1876:
1877: @filelist[]
1878: $html[^file:list[.;\.html^$]]
1879: ^html.menu{
1880: $html.name<br>
1881: }
1882: <hr>
1883:
1884: @безнадёжна_попытка_поправить_непоправимое[]
1885: $dom_from_disk[^xdoc::load[input.xml]]
1886: $dom_created_in_air[^xdoc::create[doc]]
1887: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
1888: ^show_xdoc2[$dom_created_in_air]
1889:
1890:
1891: @tcache[]
1892: #^hashfile:clear[cache]
1893: $code[^hashfile::open[$DB_HOME;cache]]
1894: ^code.cache[key](2){
1895: ^math:random(100)
1896: # ^code.delete[]
1897: }
1898:
1899: @thashfileexp[]
1900: $hf[^hashfile::open[$DB_HOME;hashfile]]
1901: $hf.paf[$.value[крут] $.expires(3)]
1902: paf=$hf.paf
1903: <hr>
1904: ^hf.foreach[key;value]{
1905: $key=$value<br>
1906: }
1907: <hr>
1908: $hash[^hf.hash[]]
1909: =$hash.paf=
1910: <hr>
1911:
1912: @tcounter[]
1913: ^tcounterone[$DB_HOME]
1914: other root:
1915: ^tcounterone[${DB_HOME}2]
1916: again, first:
1917: ^tcounterone[$DB_HOME]
1918:
1919: @tcounterone[DB_HOME]
1920: $counter[^hashfile::open[$DB_HOME;counter]]
1921: #^counter.clear[]
1922: ^counter.transaction{
1923: # $counter.value(10)
1924: $counter.value($counter.value+1)
1925: # ^counter.delete[value]
1926: $counter.value
1927: }
1928: <hr>
1929: ^rem{
1930: $hash[^counter.hash[]]
1931: =$hash.value=
1932: <hr>
1933: }
1934:
1935: @tablehash[]
1936: $productList[^table::set{id name
1937: 1 носки
1938: 2 валенки
1939: 3 ушанка
1940: }]
1941:
1942: #скажем, у первого дилера
1943: $firstPriceList[^table::set{id price
1944: 1 0.3
1945: 3 1000
1946: }]
1947:
1948: $firstPriceHash[^firstPriceList.hash[id]]
1949:
1950: ^productList.menu{
1951: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
1952: }
1953:
1954:
1955: @hashfile[]
1956: $hf[^hashfile::assign[hashfile]]
1957: #$hf.paf[крут5]
1958: paf=$hf.paf
1959:
1960: @formclass[]
1961: ^$form:CLASS.a=$form:CLASS.a
1962:
1963: @domdata[]
1964: ^if(1){
1965: # $a{^hren[]}
1966: }
1967: $a
1968: $xdoc[^xdoc::create[doc]]
1969: $doc[$xdoc.documentElement]
1970: $name[^doc.appendChild[^xdoc.createElement[name]]]
1971: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1972: ^untaint[as-is]{=$text.nodeValue=}
1973:
1974: @domedit[]
1975: ^domdata[]
1976: #$paf.nodeName<br>
1977: #$doc.documentElement.nodeName<br>
1978:
1979: ^show_xnode1[$xdoc.documentElement;0;1]
1980: <hr>
1981: ^show_xdoc2[$xdoc]
1982: <hr>
1983:
1984: @domxslt[]
1985: ^domdata[]
1986: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1987: <hr>
1988:
1989: @lsplit2[]
1990: $path[/optics/]
1991: $pathTable[^path.lsplit[/]]
1992: ^pathTable.menu{
1993: ^if(def $pathTable.piece){
1994: =$pathTable.piece=
1995: }
1996: }
1997:
1998:
1999: @faceesize[]
2000: $k(2)
2001: $pict[^image::load[paf.gif]]
2002: $small[^image::create($pict.width/$k;$pict.height/$k)]
2003: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
2004: $response:body[^small.gif[]]
2005:
2006: @imageresize[]
2007: $k(2)
2008: $pict[^image::create(400*$k;200*$k)]
2009: $pict.line-width(2)
2010: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
2011: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
2012: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
2013: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
2014: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
2015: $response:body[^pict.gif[]]
2016:
2017: #$small[^image::create($pict.width/$k;$pict.height/$k)]
2018: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
2019: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
2020:
2021: #$response:body[^small.gif[]]
2022:
2023:
2024: @tintdefault[]
2025: #$abc[abc]
2026: $abc[33]
2027: ^abc.int[z]
2028: #^abc.int(123)
2029:
2030: @ifassignhash[]
2031: $h[^if(1){$.a(1);$.a(2)}]
2032: $h.a
2033:
2034: @ifpasshash[]
2035: $a[$.e[a]]
2036: $b[$.e[b]]
2037: ^ifpasshashdest[^if(1){$a;$b}]
2038: #$x[^if(1){$a}{$b}]
2039: #^ifpasshashdest[$x]
2040:
2041: @ifpasshashdest[p]
2042: $p.e
2043:
2044: @movedir[]
2045: ^file:move[a;deeper/a]
2046:
2047: @replace[]
2048: $a[12^;3]
2049: ^a.replace[^table::set{from to
2050: 2^; !
2051: }]
2052:
2053:
2054: @set[]
2055: ^setdata[]
2056: ^a.add[$b]
2057: add:$a.3<br>
2058:
2059: ^setdata[]
2060: ^a.sub[$b]
2061: sub2:$a.2<br>
2062: sub1:$a.1<br>
2063:
2064: ^setdata[]
2065: $c[^a.union[$b]]
2066: union3:$c.3<br>
2067: union2:$c.2<br>
2068:
2069: ^setdata[]
2070: $c[^a.intersection[$b]]
2071: intersection3:$c.3<br>
2072: intersection2:$c.2<br>
2073:
2074: ^setdata[]
2075: intersects:^if(^a.intersects[$b]){y;n}<br>
2076: intersects2:^if(^a.intersects[ ]){y;n}<br>
2077:
2078:
2079: <hr>
2080:
2081: @setdata[]
2082: $a[$.1[a1] $.2[a2]]
2083: $b[ $.2[b2] $.3[b3]]
2084:
2085:
2086: @hash[]
2087: $h[^hash::create[$._default[123]]]
2088: $h.paf[not kretin]
2089: $h.paf<br>
2090: =$h.that=<br>
2091:
2092: @methresult[]
2093: $result[^table::set{1}]
2094:
2095: @terror[]
2096: ^error[method z must be called with z]
2097:
2098: @syntax1[]
2099: #^a[^b]
2100:
2101: @syntax2[]
2102: #^a[
2103:
2104: @ssave[]
2105: $abc[abc]
2106: ^abc.save[abc]
2107:
2108: @calendar[]
1.103 paf 2109: $year(2002)
2110: $month(12)
1.84 paf 2111: ${year}-${month}:<br>
2112: $week_days[^date:calendar[rus]($year;$month)]
1.15 paf 2113: <pre>
1.101 paf 2114: ^week_days.menu{^for[wday](0;6){^if($week_days.$wday){$week_days.$wday; ^; ^;} }=$week_days.week,$week_days.year=<br>}
1.15 paf 2115: </pre>
2116:
2117: @thash[]
2118: $table[^table::set{id name age
2119: 1 paf 278
2120: 2 пиф 234
2121: }]
2122: $hash[^table.hash[id;^table::set[nameless]{id
2123: name}]]
2124: $hash.2.id $hash.2.name $hash.2.age
2125:
2126: @tdef[]
2127: $s[0]
2128: if 0=^if($s){}{n}<br>
2129: if def 0=^if(def $s){y}{}<br>
2130: <hr>
2131:
2132: @ford[]
2133: ^for[i](0;5){$i}{($i)}
2134:
2135: @tif[]
2136: ^if[def]{y;n}
2137:
2138: @image[]
2139: $pict[^image::create(400;200)]
2140: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
2141: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
2142: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
2143: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
2144: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
2145: $response:body[^pict.gif[]]
2146:
2147:
2148:
2149: @mail2[]
2150: ^mail:send[
1.139 paf 2151: $.message-id[<6615%1@parser.ru>]
1.15 paf 2152: $.content-type[$.value[text/plain] $.charset[windows-1251]]
2153: $.from[Александр Петросян <paf@design.ru>]
2154: $.to[Александр Петросян <paf@design.ru>]
1.134 paf 2155: $.subject[проверка проверка]
2156: $.text[проверка]
1.15 paf 2157: ]
2158:
2159: @cookie[]
1.115 paf 2160: #$env:HTTP_COOKIE<br>
1.15 paf 2161:
2162: #$cookie:переменная[test тест ТЕСТ2]
2163: =$cookie:переменная=<br>
2164: #$cookie:переменная2[test тест ТЕСТ3]
2165: =$cookie:переменная2=<br>
2166: =$cookie:CLASS.переменная2=<br>
2167:
2168: @response[]
2169: #^if($form:reload){
2170: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
2171: #}
2172:
2173: @xslt[]
2174: ^xdata[]
2175: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
2176: ^show_xdoc2[$transformed]
2177:
2178: @regexp2[]
2179: $s[ select]
2180: $s[^s.match[^^\s*][]{!}]
2181: $s
2182:
2183: @header[]
2184: $response:refresh[
2185: $.value[0]
2186: $.url[http://design.ru?a=^taint[123]]
2187: ]
2188:
2189: @ttablerem[]
2190: $table[^table::load[a.cfg]]
2191: ^table.menu{$table.a}
2192:
2193: @tconnect[]
2194: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
2195: $tables[^table::sql{show tables}]
2196: #$cols[^tables.columns[]]
2197: #$cols.column
2198: ^tables.menu{
2199: $tables.[Tables_in_test]<br>
2200: }
2201: }
2202:
2203: @pcre[]
2204: $s[1 2]
2205: ^s.match[\s;ig]{!}
2206: #^s.match[\d;ig]{!}
2207:
2208:
2209: @regexp[]
2210: $s[abcАБВ]
2211: ^if(^s.match[б][i]){y}{n}
2212:
2213: @mail[]
2214: #$ORIGINS(1)
2215: ^mail:send[
2216: $.from[paf@design.ru]
2217: $.to[paf@design.ru]
2218: $.body[1
2219:
2220: 2
2221:
2222:
2223: 3]
2224: ]
2225:
2226: @fori[][i]
2227: ^for[i](1;3){... =$i= ...}
2228:
2229: @xdata0[]
2230: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
2231: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
2232: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
2233: <people>
2234: <man id="1" имя="word слово">
2235: <name>P«^;AF B</name>
2236: </man>
2237: <man id="2">
2238: <name>ПИФ^taint[&]</name>
2239: </man>
2240: </people>
2241: }]
2242:
2243: @xdata[]
2244: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1.156 paf 2245: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
1.15 paf 2246: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
2247: <people>
2248: <man id="1" имя="word слово">
2249: <name>P«^;AF B</name>
2250: </man>
2251: <man id="2">
2252: <name>ПИФ^taint[&]</name>
2253: </man>
2254: </people>
1.156 paf 2255: }]
1.15 paf 2256:
2257: @xml[]
2258: ^xdata[]
2259:
2260: ^show_xdoc2[$xdoc]<hr>
2261: #^show_xnode1[$xdoc]<hr>
2262: $people[^xdoc.select[*/man]]
2263: #^show1[]
2264: ^show_xnodes1[$people]<hr>
2265: #^people.0.owner.hren[]
2266:
2267: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
2268:
2269: by id:
2270: ^show_xnode1[^xdoc.getElementById[1];0;1]
2271: <hr>
2272:
2273: @show1[array]
2274: ^for[i](0;^array._count[]-1){
2275: $x[$array.$i]
2276: $x.firstChild.nodeValue:
2277: $pattributes[$x.parentNode.attributes]
2278: ^if(^pattributes._count[]){
2279: $pattributes.id.name=$pattributes.id.nodeValue
2280: }
2281: <br>
2282: }
2283:
2284: @show_xnodes1[array][i]
2285: ^for[i](0;^array._count[]-1){
2286: ^show_xnode1[$array.$i;0;1]
2287: }
2288:
2289: @show_xnode1[x;level;single][l]
2290: ^if(def $x){
2291: ^for[l](0;$level-1){ ^; ^; ^; ^;}
2292: ^if($x.nodeType == $xnode:ELEMENT_NODE){
2293: <^;$x.nodeName
2294: $pairs[$x.attributes]
2295: ^if(def $pairs){
2296: $names[^pairs._keys[]]
2297: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
2298: }
2299: >^;
2300: }{
2301: [$x.nodeType]
2302: }
2303:
2304: ^if(def $x.nodeValue){$x.nodeValue}<br>
2305: ^show_xnode1[$x.firstChild]($level+1)
2306: ^if(!$single){
2307: ^show_xnode1[$x.nextSibling]($level)
2308: }
2309:
2310: ^if($x.nodeType == $xnode:ELEMENT_NODE){
2311: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
2312: }
2313: }
2314:
2315: @show_xdoc2[xdoc]
2316: ^xdoc.save[out/save.xml;
2317: # $.encoding[utf-8]
2318: $.method[xml]
2319: ]
2320: $file[^xdoc.file[
2321: $.encoding[utf-8]
2322: $.method[html]
2323: ]]
2324: ^file.save[text;out/save_file.html]
2325: #$response:body[^xdoc.file[ $.media-type[text/paf] ]]
2326: <pre>^taint[html][^xdoc.string[
2327: $.method[html]
2328: # $.encoding[utF-8]
2329: # $.omit-xml-declaration[yes]
2330: # $.standalone[no]
2331: # -$.doctype-public[-//W3C//DTD XHTML]
2332: # -$.doctype-system[/a/b/c/]
2333: # $.indent[yes]
2334: # $.media-type[text/paf]
2335: ]]
2336: </pre>
E-mail: