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