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