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