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