Annotation of parser3/src/www/htdocs/index.html, revision 1.475
1.399 parser 1: @main[]
1.475 ! paf 2: #^xloadwrongtable[]
! 3: ^xsetwrongtable[]
1.473 paf 4: #^if($form:test){y}{n}
1.472 paf 5: #^tablecolumnerror[]
6: #^roll[]
1.471 paf 7: #^cookie2[]
1.470 paf 8: #^tableset[]
1.469 paf 9: #^math:PI.format{%.30f}
1.462 paf 10: #^xchildren[]
11: #^thashforeach3[]
1.461 paf 12: #^thashforeach2[]
13: #^thashforeach[]
1.458 paf 14: #^thashdelete[]
1.456 paf 15: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
1.454 paf 16: #^tappend[]
1.453 paf 17: #^sappend[]
1.452 paf 18: #^eval(10\3)<br>
1.450 paf 19: #^tform[]
1.448 paf 20: #^formattest[]
1.447 paf 21: #^filelist[]
1.443 paf 22: #^connect[mysql://user:pass@host]{ }
1.431 paf 23: #^безнадёжна_попытка_поправить_непоправимое[]
1.430 parser 24: #^tcache[]
1.460 paf 25: #^thashfileexp[]
1.468 paf 26: #^tcounter[]
1.423 parser 27: #^tablehash[]
1.443 paf 28: #j^hashfile[]
1.417 parser 29: #^formclass[]
1.415 parser 30: #^hren[]
1.475 ! paf 31: #^domedit[]
! 32: #^domxslt[]
1.402 parser 33: #^lsplit2[]
1.401 parser 34: #^faceesize[]
1.445 paf 35: #^imageresize[]
1.399 parser 36: #^ifassignhash[]
37: #^tintdefault[]
38: #$response:status[404]
1.390 parser 39: #^ifpasshash[]
1.387 parser 40: #^movedir[]
41: #^replace[]
1.416 parser 42: #^set[]
1.385 parser 43: #^hash[]<hr>
1.384 parser 44: #$t[^methresult[]] ->$t
1.382 parser 45: #^terror[]
1.378 parser 46: #^ssave[]
1.377 parser 47: #^calendar[]
1.376 parser 48: #^thash[]
1.373 parser 49: #^tdef[]
1.375 parser 50: #^ford[]
1.371 parser 51: #^tif[]
1.383 parser 52: #^image[]
1.369 parser 53: #^mail2[]
1.413 parser 54: #^cookie[]
1.365 parser 55: #^response[]
1.364 parser 56: #^regexp2[]
57: #^ttablerem[]
58: #^pcre[]
59: #^regexp[]<hr>
60: #^mail[]
61: #^exec[]
62: #^fori[]
1.468 paf 63: #^tconnect[]
1.470 paf 64: #^xslt[]
65: #^xml[]
1.364 parser 66: #^header[]
67: OK
1.475 ! paf 68:
! 69: @xloadwrongtable[]
! 70: $constr[^xdoc::load[wrongtable.xml]]
! 71:
! 72: @xsetwrongtable[]
! 73: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
! 74: <block-list>^untaint[as-is]{$constructor}</block-list>}]
! 75:
1.471 paf 76:
1.472 paf 77: @tablecolumnerror[]
78: $t[^table::set{a}]
79: $t.$a
80:
1.471 paf 81: @roll[]
1.472 paf 82: #$date[^date::set(1970;1;2)]
83: #^date.roll[month](-1)
84: $date[^date::set(2038;1;1)]
1.471 paf 85: ^date.roll[month](+1)
86: $date.year $date.month $date.day
1.470 paf 87:
88: @cookie2[]
89: #=$cookie:clientType[$.value[test]]=<br>
90: =$cookie:clientType=<br>
91:
1.469 paf 92:
93: @tableset[]
94: $a[^table::set{a
95: 1
96: 2}]
97: ^eval(100\$a)
98:
99:
100:
101: @zzz[]
102:
1.462 paf 103:
104: $constructor[
105: <block1 name="main_srvr" type="0" label="Основное тело" />
106: <block2 name="main_srvr2" type="0" label="Основное тело" />
107: ]
108:
109: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
110: <block-list>^untaint[as-is]{$constructor}</block-list>}]
111:
112: $children[$constr.documentElement.childNodes]
113: ^if($children){
114: ^for[i](1;^children._count[]){
115: $node[$children.$i]
116: $node.nodeName<br>
117: }
118: }
119:
1.461 paf 120:
121: @thashforeach3[]
122: $h[
123: $.a[1]
124: $.b[2]
125: ]
126: $c[^table::set{a
127: ^h.foreach[key;value]{$value
128: }}]
129: $c.a
130:
131: @thashforeach2[]
132: $h[
133: $.a[1]
134: $.b[2]
135: ]
136: $c[
137: ^h.foreach[key;value]{
138: $.$key[$value]
139: }
140: ]
141: $c.b
1.458 paf 142:
143: @thashforeach[]
144: $h[
145: $.a[1]
146: $.b[2]
147: ]
148: ^h.foreach[key;value]{
149: $key=$value<br>
150: }
1.457 paf 151:
152: @thashdelete[]
153: $h[$.a[1] $.b[2]]
154: was:<br>
155: count=^h._count[] <br>
156: b='$h.b' <br>
157:
158: ^h.delete[b]
159:
160: now:<br>
161: count=^h._count[] <br>
162: b='$h.b'
1.452 paf 163:
164: @sappend[]
165: $test[123]
166: ^test.save[test]
167: ^test.save[append;test]
168:
1.453 paf 169: @tappend[]
170: $test[^table::set{a b
171: a1 b1}]
172: ^test.save[test]
173: $test[^table::set{a b
174: a2 b2}]
175: ^test.save[append;test]
1.452 paf 176:
1.448 paf 177:
178: @tform[]
1.449 paf 179: ^if(def $form:new_file){y}{n}
180: <form method="post" enctype="multipart/form-data">
181: <input type="file" name="new_file" />
1.448 paf 182: <input type=submit>
183: </input>
1.447 paf 184:
185: @formattest[]
186: $size(15.124)
187:
188: ^size.format{%.2f}
1.446 paf 189:
190: @filelist[]
191: $html[^file:list[.;\.html^$]]
192: ^html.menu{
193: $html.name<br>
194: }
195: <hr>
1.431 paf 196:
197: @безнадёжна_попытка_поправить_непоправимое[]
198: $dom_from_disk[^xdoc::load[input.xml]]
199: $dom_created_in_air[^xdoc::create[doc]]
200: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
201: ^show-xdoc2[$dom_created_in_air]
202:
1.426 parser 203:
1.428 parser 204: @tcache[]
205: #^hashfile:clear[cache]
1.459 paf 206: $code[^hashfile::open[$DB_HOME;cache]]
1.430 parser 207: ^code.cache[key](2){
208: ^math:random(100)
209: # ^code.delete[]
1.428 parser 210: }
211:
212:
1.426 parser 213: @thashfileexp[]
1.459 paf 214: $hf[^hashfile::open[$DB_HOME;hashfile]]
1.428 parser 215: $hf.paf[$.value[крут] $.expires(3)]
216: paf=$hf.paf
1.459 paf 217: <hr>
218: ^hf.foreach[key;value]{
219: $key=$value<br>
220: }
1.427 parser 221: <hr>
222: $hash[^hf.hash[]]
223: =$hash.paf=
224: <hr>
1.420 parser 225:
1.423 parser 226: @tcounter[]
1.440 paf 227: ^tcounterone[$DB_HOME]
1.466 paf 228: other root:
229: ^tcounterone[${DB_HOME}2]
230: again, first:
231: ^tcounterone[$DB_HOME]
1.432 paf 232:
233: @tcounterone[DB_HOME]
234: $counter[^hashfile::open[$DB_HOME;counter]]
1.440 paf 235: #^counter.clear[]
1.423 parser 236: ^counter.transaction{
237: # $counter.value(10)
238: $counter.value($counter.value+1)
239: # ^counter.delete[value]
240: $counter.value
241: }
1.424 parser 242: <hr>
1.432 paf 243: ^rem{
1.424 parser 244: $hash[^counter.hash[]]
1.425 parser 245: =$hash.value=
1.424 parser 246: <hr>
1.432 paf 247: }
1.423 parser 248:
249: @tablehash[]
250: $productList[^table::set{id name
251: 1 носки
252: 2 валенки
253: 3 ушанка
254: }]
255:
256: #скажем, у первого дилера
257: $firstPriceList[^table::set{id price
258: 1 0.3
259: 3 1000
260: }]
261:
262: $firstPriceHash[^firstPriceList.hash[id]]
263:
264: ^productList.menu{
265: продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
266: }
267:
268:
1.420 parser 269: @hashfile[]
270: $hf[^hashfile::assign[hashfile]]
1.423 parser 271: #$hf.paf[крут5]
1.420 parser 272: paf=$hf.paf
1.402 parser 273:
1.417 parser 274: @formclass[]
275: ^$form:CLASS.a=$form:CLASS.a
276:
1.406 parser 277: @domdata[]
1.418 parser 278: ^if(1){
1.422 parser 279: # $a{^hren[]}
1.418 parser 280: }
1.419 parser 281: $a
1.408 parser 282: $xdoc[^xdoc::create[doc]]
283: $doc[$xdoc.documentElement]
1.473 paf 284: $name[^doc.appendChild[^xdoc.createElement[name]]]
1.474 paf 285: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
1.435 paf 286: ^untaint[as-is]{=$text.nodeValue=}
1.406 parser 287:
288: @domedit[]
289: ^domdata[]
1.404 parser 290: #$paf.nodeName<br>
291: #$doc.documentElement.nodeName<br>
292:
1.406 parser 293: ^show-xnode1[$xdoc.documentElement;0;1]
294: <hr>
295: ^show-xdoc2[$xdoc]
1.411 parser 296: <hr>
1.406 parser 297:
298: @domxslt[]
299: ^domdata[]
1.405 parser 300: ^show-xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
1.411 parser 301: <hr>
1.401 parser 302:
303: @lsplit2[]
304: $path[/optics/]
305: $pathTable[^path.lsplit[/]]
306: ^pathTable.menu{
307: ^if(def $pathTable.piece){
308: =$pathTable.piece=
309: }
310: }
311:
1.395 parser 312:
1.397 parser 313: @faceesize[]
314: $k(2)
315: $pict[^image::load[paf.gif]]
316: $small[^image::create($pict.width/$k;$pict.height/$k)]
1.398 parser 317: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
1.397 parser 318: $response:body[^small.gif[]]
319:
1.395 parser 320: @imageresize[]
321: $k(2)
322: $pict[^image::create(400*$k;200*$k)]
323: $pict.line-width(2)
1.444 paf 324: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
325: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
1.395 parser 326: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
1.444 paf 327: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
328: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
329: $response:body[^pict.gif[]]
1.395 parser 330:
1.443 paf 331: #$small[^image::create($pict.width/$k;$pict.height/$k)]
1.396 parser 332: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
1.443 paf 333: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
1.395 parser 334:
1.443 paf 335: #$response:body[^small.gif[]]
1.395 parser 336:
1.388 parser 337:
338: @tintdefault[]
339: #$abc[abc]
340: $abc[33]
341: ^abc.int[z]
342: #^abc.int(123)
1.390 parser 343:
344: @ifassignhash[]
345: $h[^if(1){$.a(1);$.a(2)}]
346: $h.a
1.387 parser 347:
348: @ifpasshash[]
349: $a[$.e[a]]
350: $b[$.e[b]]
1.389 parser 351: ^ifpasshashdest[^if(1){$a;$b}]
1.387 parser 352: #$x[^if(1){$a}{$b}]
353: #^ifpasshashdest[$x]
354:
355: @ifpasshashdest[p]
356: $p.e
357:
358: @movedir[]
359: ^file:move[a;deeper/a]
1.386 parser 360:
361: @replace[]
362: $a[12^;3]
363: ^a.replace[^table::set{from to
364: 2^; !
365: }]
366:
1.385 parser 367:
368: @set[]
369: ^setdata[]
370: ^a.add[$b]
371: add:$a.3<br>
372:
373: ^setdata[]
374: ^a.sub[$b]
375: sub2:$a.2<br>
376: sub1:$a.1<br>
377:
378: ^setdata[]
379: $c[^a.union[$b]]
380: union3:$c.3<br>
381: union2:$c.2<br>
382:
383: ^setdata[]
384: $c[^a.intersection[$b]]
385: intersection3:$c.3<br>
386: intersection2:$c.2<br>
387:
388: ^setdata[]
389: intersects:^if(^a.intersects[$b]){y;n}<br>
390: intersects2:^if(^a.intersects[ ]){y;n}<br>
391:
392:
393: <hr>
394:
395: @setdata[]
396: $a[$.1[a1] $.2[a2]]
397: $b[ $.2[b2] $.3[b3]]
398:
1.383 parser 399:
1.384 parser 400: @hash[]
401: $h[^hash::create[$._default[123]]]
402: $h.paf[not kretin]
403: $h.paf<br>
404: =$h.that=<br>
405:
406: @methresult[]
407: $result[^table::set{1}]
1.377 parser 408:
1.381 parser 409: @terror[]
410: ^error[method z must be called with z]
411:
1.380 parser 412: @syntax1[]
413: #^a[^b]
414:
415: @syntax2[]
1.381 parser 416: #^a[
1.379 parser 417:
1.377 parser 418: @ssave[]
419: $abc[abc]
420: ^abc.save[abc]
1.376 parser 421:
422: @calendar[]
423: 2001;11:<br>
424: $week_days[^date:calendar[rus](2001;11)]
425: <pre>
426: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday; ^; ^;} }<br>}
427: </pre>
1.372 parser 428:
1.375 parser 429: @thash[]
430: $table[^table::set{id name age
431: 1 paf 278
432: 2 пиф 234
433: }]
434: $hash[^table.hash[id;^table::set[nameless]{id
435: name}]]
436: $hash.2.id $hash.2.name $hash.2.age
437:
1.372 parser 438: @tdef[]
439: $s[0]
440: if 0=^if($s){}{n}<br>
441: if def 0=^if(def $s){y}{}<br>
442: <hr>
1.371 parser 443:
444: @ford[]
1.374 parser 445: ^for[i](0;5){$i}{($i)}
1.368 parser 446:
1.370 parser 447: @tif[]
448: ^if[def]{y;n}
449:
1.368 parser 450: @image[]
451: $pict[^image::create(400;200)]
1.379 parser 452: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
453: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
454: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
455: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
456: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
1.368 parser 457: $response:body[^pict.gif[]]
458:
459:
1.366 parser 460:
1.369 parser 461: @mail2[]
1.367 parser 462: ^mail:send[
1.369 parser 463: $.content-type[$.value[text/plain] $.charset[windows-1251]]
464: $.from[Александр Петросян <paf@design.ru>]
1.367 parser 465: $.to[Александр Петросян <paf@design.ru>]
1.369 parser 466: $.subject[проверка]
467: $.body[проверка]
1.367 parser 468: ]
469:
1.366 parser 470: @cookie[]
1.367 parser 471: $env:HTTP_COOKIE<br>
472:
473: #$cookie:переменная[test тест ТЕСТ2]
474: =$cookie:переменная=<br>
475: #$cookie:переменная2[test тест ТЕСТ3]
476: =$cookie:переменная2=<br>
1.412 parser 477: =$cookie:CLASS.переменная2=<br>
1.365 parser 478:
479: @response[]
480: #^if($form:reload){
481: $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
482: #}
1.364 parser 483:
484: @xslt[]
485: ^xdata[]
1.407 parser 486: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
487: ^show-xdoc2[$transformed]
1.364 parser 488:
489: @regexp2[]
490: $s[ select]
491: $s[^s.match[^^\s*][]{!}]
492: $s
493:
494: @header[]
495: $response:refresh[
496: $.value[0]
497: $.url[http://design.ru?a=^taint[123]]
498: ]
499:
500: @ttablerem[]
501: $table[^table::load[a.cfg]]
502: ^table.menu{$table.a}
503:
504: @tconnect[]
505: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
506: $tables[^table::sql{show tables}]
507: #$cols[^tables.columns[]]
508: #$cols.column
509: ^tables.menu{
510: $tables.[Tables_in_test]<br>
511: }
512: }
513:
514: @pcre[]
515: $s[1 2]
516: ^s.match[\s;ig]{!}
517: #^s.match[\d;ig]{!}
518:
519:
520: @regexp[]
521: $s[abcАБВ]
522: ^if(^s.match[б][i]){y}{n}
523:
524: @mail[]
525: #$ORIGINS(1)
526: ^mail:send[
527: $.from[paf@design.ru]
528: $.to[paf@design.ru]
529: $.body[1
530:
531: 2
532:
533:
534: 3]
535: ]
536:
537: @exec[]
1.370 parser 538: $a[^file::exec[fc.exe;;a;b]]
1.364 parser 539: $a.status|$a.stderr<hr>
540:
541: @fori[][i]
542: ^for[i](1;3){... =$i= ...}
543:
544: @xdata[]
545: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
1.468 paf 546: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
547: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
548:
549: <people>
550: <man id="1" имя="word слово">
551: <name>P«^;AF B</name>
552: </man>
553: <man id="2">
554: <name>ПИФ^taint[&]</name>
555: </man>
556: </people>
557: }]
1.364 parser 558:
559: @xml[]
560: ^xdata[]
561:
562: ^show-xdoc2[$xdoc]<hr>
563: #^show-xnode1[$xdoc]<hr>
564: $people[^xdoc.select[*/man]]
565: #^show1[]
566: ^show-xnodes1[$people]<hr>
567: #^people.0.owner.hren[]
568:
1.393 parser 569: ^show-xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
1.364 parser 570:
571: by id:
572: ^show-xnode1[^xdoc.getElementById[1];0;1]
573: <hr>
574:
575: @show1[array]
576: ^for[i](0;^array._count[]-1){
577: $x[$array.$i]
578: $x.firstChild.nodeValue:
579: $pattributes[$x.parentNode.attributes]
580: ^if(^pattributes._count[]){
581: $pattributes.id.name=$pattributes.id.nodeValue
582: }
583: <br>
584: }
585:
586: @show-xnodes1[array][i]
587: ^for[i](0;^array._count[]-1){
588: ^show-xnode1[$array.$i;0;1]
589: }
590:
591: @show-xnode1[x;level;single][l]
592: ^if(def $x){
593: ^for[l](0;$level-1){ ^; ^; ^; ^;}
594: ^if($x.nodeType == $xnode:ELEMENT_NODE){
595: <^;$x.nodeName
596: $pairs[$x.attributes]
597: ^if(def $pairs){
598: $names[^pairs._keys[]]
599: ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
600: }
601: >^;
602: }{
603: [$x.nodeType]
604: }
605:
606: ^if(def $x.nodeValue){$x.nodeValue}<br>
607: ^show-xnode1[$x.firstChild]($level+1)
608: ^if(!$single){
609: ^show-xnode1[$x.nextSibling]($level)
610: }
611:
612: ^if($x.nodeType == $xnode:ELEMENT_NODE){
613: ^for[l](0;$level-1){ ^; ^; ^; ^;}<^;/$x.nodeName>^;<br>
614: }
615: }
616:
617: @show-xdoc2[xdoc]
1.473 paf 618: ^xdoc.save[out/save.xml;
1.364 parser 619: # $.encoding[windows-1251]
620: $.method[xml]
621: ]
622: $file[^xdoc.file[
623: # $.encoding[windows-1251]
624: $.method[html]
625: ]]
1.473 paf 626: ^file.save[text;out/save_file.html]
1.463 paf 627: <pre>^taint[^xdoc.string[]]
1.364 parser 628: # $.encoding[windows-1251]
1.413 parser 629: # $.method[html]
1.364 parser 630: #]]
1.413 parser 631: </pre>
1.435 paf 632:
E-mail: