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