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