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