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