Annotation of parser3/www/htdocs/index.html, revision 1.66

1.61      paf         1: #@USE
                      2: #t.p
1.15      paf         3: 
1.63      paf         4: @autoZ[]
                      5: #$form:here
1.15      paf         6: $request:charset[windows-1251]
                      7: $response:charset[windows-1251]
                      8: $response:content-type[$.value[text/html]$.charset[$response:charset]]
                      9: 
1.60      paf        10: #@postprocess[body]
                     11: #<b>$body</b>
                     12: #$result[123]
1.37      paf        13: 
1.15      paf        14: @main[]
1.61      paf        15: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
                     16: #      ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
                     17: #    ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
                     18: #}
1.49      paf        19: #^eval(2)
1.48      paf        20: #^tcrashlocaljunctionsv2[]
1.49      paf        21: #^tcrashlocaljunctions[]
1.50      paf        22: #^tjunctions[]
1.47      paf        23: #^replacetest[]
1.48      paf        24: #^matchoptionpp[]
1.46      paf        25: #^txdocxnodechild[]
1.44      paf        26: #^tclasses[]
1.43      paf        27: #$math:PI
                     28: #^b:method[]
1.42      paf        29: #^main[]
1.41      paf        30: #^errort[]
1.44      paf        31: #^tselectNumber[]
1.39      paf        32: #$result[hello]
1.36      paf        33: #^invaliddate2[]
                     34: #^process2[]
                     35: #^casehashtext[]
1.35      paf        36: #^subjvaltest[]
                     37: #^tableselect0[]
1.34      paf        38: #^memnotest1[]
1.33      paf        39: #^transparams[]
1.32      paf        40: #^voidparams[]
1.31      paf        41: #^rolls2[]
1.30      paf        42: #^cacheexpireschanging[]
1.29      paf        43: #^cacheexpiresfixed[]
                     44: #^dateoffsets[]
                     45: #^exceptionTypes[]
1.28      paf        46: #^roll2[]
1.27      paf        47: #^rolls[]
1.25      paf        48: #^exceptions1[]
1.22      paf        49: #^locate_by_expr[]
1.18      paf        50: #^method_junction_params{...}
1.17      paf        51: #^verifyCookie[paf]
1.37      paf        52: #^execlangs[]
1.16      paf        53: #$t[^tobjeresult[]]$t.a
                     54: #^xmlprobs[]
1.15      paf        55: #^doubleprobs[]
                     56: #^math:random(-10)
                     57: #^divnamestop[]
                     58: #^arrayclone[]
                     59: #^operator_tricks[]
                     60: #^xoutputrusattr[]
                     61: #^xdocset1[]
                     62: #^regexp3[]
                     63: #^exec2[]
                     64: #^tlock[]
                     65: #^xmloutattrwithoutvalue[]
                     66: #^precisionProblem[]
                     67: #^xpath[]
                     68: #^ttablesetlang[]
                     69: #^mail3[]
                     70: #^ttime[]
                     71: #^tupper[]
                     72: #^treplace[]
                     73: #^xslt2[]
                     74: #^tcache2[]
                     75: #$ORIGINS(1)
                     76: #$t[^table::set{a b} ^table::set{c d}]
                     77: #^ttaintuntaint[]
                     78: #^tappend2[]
                     79: #^badvsnprintf[]
                     80: #^badoracequoting[]
                     81: #^badconstructors[]
                     82: #^xloadwrongtable[]
                     83: #^xsetwrongtable[]
                     84: #^if($form:test){y}{n}
                     85: #^tablecolumnerror[]
                     86: #^roll[]
                     87: #^cookie2[]
                     88: #^tableset[]
                     89: #^math:PI.format{%.30f}
                     90: #^xchildren[]
                     91: #^thashforeach3[]
                     92: #^thashforeach2[]
                     93: #^thashforeach[]
                     94: #^thashdelete[]
                     95: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
                     96: #^tappend[]
                     97: #^sappend[]
                     98: #^eval(10\3)<br>
                     99: #^tform[]
                    100: #^formattest[]
                    101: #^filelist[]
                    102: #^connect[mysql://user:pass@host]{ }
                    103: #^безнадёжна_попытка_поправить_непоправимое[]
                    104: #^tcache[]
                    105: #^thashfileexp[]
                    106: #^tcounter[]
                    107: #^tablehash[]
                    108: #j^hashfile[]
                    109: #^formclass[]
                    110: #^hren[]
                    111: #^domedit[]
                    112: #^domxslt[]
                    113: #^lsplit2[]
                    114: #^faceesize[]
                    115: #^imageresize[]
                    116: #^ifassignhash[]
                    117: #^tintdefault[]
                    118: #$response:status[404]
                    119: #^ifpasshash[]
                    120: #^movedir[]
                    121: #^replace[]
                    122: #^set[]
                    123: #^hash[]<hr>
                    124: #$t[^methresult[]] ->$t
                    125: #^terror[]
                    126: #^ssave[]
                    127: #^calendar[]
                    128: #^thash[]
                    129: #^tdef[]
                    130: #^ford[]
                    131: #^tif[]
                    132: #^image[]
                    133: #^mail2[]
                    134: #^cookie[]
                    135: #^response[]
                    136: #^regexp2[]
                    137: #^ttablerem[]
                    138: #^pcre[]
                    139: #^regexp[]<hr>
                    140: #^mail[]
                    141: #^exec[]
                    142: #^fori[]
                    143: #^tconnect[]
                    144: #^xslt[]
                    145: #^xml[]
                    146: #^header[]
1.53      paf       147: #^tablehasht[]
1.54      paf       148: #^datecreatestring[]
1.56      paf       149: #^mssqltypes1[]
                    150: #^badthrows[]
1.57      paf       151: #^xmlspace[]
                    152: #^counter[main.counter]
                    153: #^xpath2[]
                    154: #^callindirect[]
                    155: #^junctionprob[]
1.59      paf       156: #^datecreatestring2[]
                    157: #^tstoredproc[]
                    158: #^tstoredproc2[]
                    159: #^forkeys[]
1.60      paf       160: #^pngsize[]
1.61      paf       161: #^checkList[]
1.63      paf       162: #^datetest[]
1.65      paf       163: #^tserge[]
                    164: ^envt[]
                    165: 
                    166: @envt[]
1.66    ! paf       167: $f[^file::exec[showenv.cmd;
        !           168:        $.bad[value]
        !           169:        $.CGI_good[value]
        !           170: ]]
1.65      paf       171: $f.status<br>
                    172: $f.stderr<br>
                    173: <pre>$f.text</pre>
                    174: 
1.63      paf       175: 
                    176: @tserge[]
1.64      paf       177: ^if(" 09 "){y}
1.61      paf       178: 
                    179: @datetest[]
                    180:        $f[^file::stat[some.zip]]
                    181: Размер в байтах: $f.size<br>
                    182: Год создания: $f.cdate.year<br>
                    183: $now[^date::now[]]
                    184: $DAYS_CONSIDERED_NEW(3)
                    185: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
                    186: 
1.60      paf       187: 
                    188: @checkList[]
                    189: ...^oneOf[a;a,b,c]...<br>
                    190: #...^oneOf[a;ax,b,c]...<br>
                    191: ...^oneWord[word]...<br>
                    192: #...^oneWord[wo rd]...<br>
                    193: 
                    194: 
                    195: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
                    196: $t[^list.lsplit[,]]
                    197: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
                    198: $result[$s]
                    199: 
                    200: @oneWord[s]
                    201: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59      paf       202: 
                    203: @pngsize[]
                    204: $i[^image::measure[test.png]]
                    205: ^i.html[]
                    206: 
                    207: 
                    208: @forkeys[]
                    209: $text[^form:fields.foreach[key;val]{$key=$val
                    210: }]
                    211: ^text.save[ttt.txt]
                    212: =$text=
                    213: 
                    214: 
                    215: @tstoredproc2[]
                    216: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
                    217:        ^void:sql{exec pafvoid}
                    218: }
                    219: 
                    220: @tstoredproc[]
                    221: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
                    222:        $t[^table::sql{exec pafproc}]
                    223: #      $t[^table::sql{{call pafproc}}]
                    224:        $c[^t.columns[]]
                    225:        ^c.menu{$c.column}[<br>]
                    226: }
1.57      paf       227: 
                    228: @datecreatestring2[]
1.58      paf       229: <table border=1>
                    230: ^datecreatestring2show[2000]
                    231: ^datecreatestring2show[2000-02]
1.59      paf       232: ^datecreatestring2show[2000-2-03]
1.58      paf       233: ^datecreatestring2show[2000-02-03 15]
                    234: ^datecreatestring2show[2000-02-03 15:30] 
                    235: ^datecreatestring2show[2000-02-03 15:30:04] 
                    236: ^datecreatestring2show[2000-02-03 15:30:04 hren] 
                    237: ^datecreatestring2show[15:30] 
                    238: ^datecreatestring2show[15:30:05] 
                    239: ^datecreatestring2show[15:30:05 hren] 
                    240: </table>
                    241: 
                    242: @datecreatestring2show[s]
                    243: $date[^date::create[$s]]
                    244: <tr>
                    245: <td>$s</td><td align=right>^date.sql-string[]</td>
                    246: </tr>
                    247: 
1.57      paf       248: 
                    249: @junctionprob[][l]
                    250: $l[123]
                    251: $a{$l}
                    252: ^junctionprobnested[$a]
                    253: @junctionprobnested[p]
                    254: $p
                    255: 
                    256: 
                    257: @callindirecttarget[]
                    258: callindirecttarget called
                    259: @callindirect[]
                    260: $f[$callindirecttarget]
                    261: ^f[]
                    262: 
                    263: @xpath2[]
                    264: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
                    265: <doc>
                    266: <field-list>
                    267: <field name="aa"/>
                    268: <field name="bb"/>
                    269: </field-list>
                    270: </doc>
                    271: }]
                    272: 
                    273: #^xdoc.string[]
                    274: 
                    275: $fieldList[^xdoc.selectSingle[/doc/field-list]]
                    276: #^fieldList.childNodes._count[]
                    277: $fields[^fieldList.select[field]]
                    278: #^fields._count[]
                    279: ^fields.foreach[k;node]{
                    280:        $node.nodeName<br>
                    281: }
                    282: @counter[filespec][f;s]
                    283: ^file:lock[$filespec]{
                    284:        $f[^file::load[text;$filespec]]
                    285:        $s[^eval($f.text+1)]
                    286:        ^s.save[$filespec]      
                    287: }
                    288: $s
1.56      paf       289: 
                    290: @xmlspace[]
                    291: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                    292: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                    293: <people>
                    294:        <man id="1" имя="word слово">
                    295:                <name>1  2</name>
                    296:        </man>
                    297: </people>
                    298: }}]
                    299: $xdoc[^xdoc.transform[global.xsl]]
                    300: $string[^xdoc.string[$.method[html]]]
                    301: ^string.save[a]
                    302: ^untaint[html]{$string}
                    303: 
                    304: @badthrows[]
                    305: #^throw[a;b;]
                    306: ^throw[a;]
1.54      paf       307: 
                    308: @mssqltypes1[]
                    309: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55      paf       310: #    ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
                    311: #    ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
                    312: #      ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
                    313:        $t[^table::sql{select a from paf}]
                    314:        ^t.count[]
1.54      paf       315: }
1.51      paf       316: 
1.53      paf       317: @datecreatestring[]
1.54      paf       318: $d[^date::create[2002-04-33 01:03:04]]
1.53      paf       319: ^d.sql-string[]
1.52      paf       320: 
                    321: @method[hash]
                    322: $hash.key
                    323: @mainZ[]
                    324: ^method[
                    325:     $.key{code}
                    326: ]
                    327: 
1.51      paf       328: @tablehasht[]
                    329: $t[^table::create{p
                    330: 1
                    331: 3
                    332: 2
                    333: 4}]
                    334: 
                    335: $h[^t.hash[p]]
                    336: 
                    337: =^h._count[]=
                    338: 
                    339: 
                    340: @sqldefaults[]
                    341: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
                    342:        ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
                    343:     ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
                    344: }
1.60      paf       345: =======
                    346: <hr>
                    347: OK
                    348: >>>>>>> 1.50
1.48      paf       349: 
                    350: @tcrashlocaljunctionsv2[]
                    351: $a[
                    352:        $b{  $c[1] }
                    353: ]
                    354: $b
                    355: $c
                    356: 
                    357: @tcrashlocaljunctions[]
                    358: $var[aaa]
                    359: ^if(1){
                    360: ^tcrashlocaljunctions1[]
                    361: }
                    362: 
                    363: $j
                    364: 
1.49      paf       365: @tcrashlocaljunctions1[][var]
                    366: $var[varvalue]
1.48      paf       367:        $j{
                    368:                $var
                    369:        }
1.49      paf       370: $j
1.48      paf       371: 
                    372: @tjunctions[][tl]
                    373: $t[^t::create[]]
                    374: ^tjunctionsi[]
                    375: 
                    376: @tjunctionsi[][tl]
                    377: $tl[12345]
                    378: ^t.tjunctionsm[
                    379:        $.key{
                    380:                $tl
                    381:        }
                    382: ]
1.46      paf       383: 
1.47      paf       384: @replacetest[]
                    385: $b[b]
                    386: $s[
                    387: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    388: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    389: ]
                    390: ^s.replace[^table::create{from to
                    391: ba     !_}]
                    392: 
                    393: 
1.46      paf       394: @matchoptionpp[]
1.47      paf       395: #$ORIGINS(1)
1.46      paf       396: $s[
                    397: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47      paf       398: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    399: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    400: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    401: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    402: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    403: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    404: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    405: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    406: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46      paf       407: ]
                    408: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
                    409: 
1.44      paf       410: 
                    411: @txdocxnodechild[]
                    412: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
                    413: $xdoc.nodeName
                    414: ^xdoc.selectNumber[2*2]
1.45      paf       415: $xdoc:ELEMENT_NODE
1.44      paf       416: 
                    417: 
                    418: @tclasses[]
                    419: $t[^t::create[]]
                    420: ^t.method[]
                    421: <hr>
                    422: ^t.base_method[]
                    423: 
1.40      paf       424: 
                    425: @errort[]
1.42      paf       426: ^xdoc::create[a]
1.40      paf       427: #^throw[user;here;this]
                    428: 
                    429: @tselectNumber[]
                    430: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
                    431: ^d.selectString[string(d/@attr)]<br>
                    432: ^d.selectNumber[2*2]<br>
                    433: ^d.selectNumber[number(/d/@n)+1]<br>
                    434: 
1.34      paf       435: 
1.36      paf       436: @invaliddate2[]
                    437: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
                    438: 
                    439: @process2[]
                    440: ^^process{
                    441:        ^process{
                    442:                ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
                    443:        }
                    444: }
                    445: 
1.35      paf       446: @casehashtext[]
                    447: $tt[1]
                    448: $tmp[
                    449:         ^switch[$tt]{
                    450:                 ^case[1]{
                    451:                         $.aaa[123]
                    452:                 }
                    453:                 ^case[DEFAULT]{
                    454:                         $.bbb[456]
                    455:                 }
                    456:         }
1.36      paf       457:         shit!
1.35      paf       458: ]
1.36      paf       459: #$tmp
1.35      paf       460: $tmp.aaa
                    461: 
                    462: @subjvaltest[]
                    463: $a12[val]
                    464: $b[12]
                    465: $a$b
                    466: 
1.34      paf       467: @tableselect0[]
                    468: $person[^table::create{name    height
                    469: paf    1.77
                    470: шохин  2.07
                    471: moko   1.77
                    472: }]
                    473: $nottoohigh[^person.select($person.height<2)]
                    474: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32      paf       475: 
                    476: @transparams[]
                    477: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
                    478: $odoc[^idoc.transform[global.xsl;
                    479:        $.param1['1']
                    480:        $.param2['2']
                    481: ]]
                    482: <pre>^taint[^odoc.string[$.method[html]]]
                    483: 
                    484: @memnotest1[]
                    485: ^for[i](0;4000){
                    486: 
                    487:  $xxxx[$i]
                    488:  $xxxx
                    489: 
                    490: }
                    491: 
                    492: @memnotest1notes[]
                    493: одна итерация цикла:
                    494: [Mon Apr  8 20:12:02 2002] execution-------------------------|
1.35      paf       495: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32      paf       496: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
                    497: [Mon Apr  8 20:12:02 2002]  "|| "
                    498: [Mon Apr  8 20:12:02 2002] 12:WITH_ROOT
                    499: [Mon Apr  8 20:12:02 2002] 13:VALUE
                    500: [Mon Apr  8 20:12:02 2002]  "xxxx" string
1.35      paf       501: [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       502: [Mon Apr  8 20:12:02 2002] 16:WITH_READ
                    503: [Mon Apr  8 20:12:02 2002] 17:VALUE
                    504: [Mon Apr  8 20:12:02 2002]  "i" string
                    505: [Mon Apr  8 20:12:02 2002] 18:GET_ELEMENT
1.35      paf       506: [Mon Apr  8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
                    507: [Mon Apr  8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32      paf       508: [Mon Apr  8 20:12:02 2002] 15:CONSTRUCT_VALUE
                    509: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
                    510: [Mon Apr  8 20:12:02 2002]  "| "
                    511: [Mon Apr  8 20:12:02 2002] 12:WITH_READ
                    512: [Mon Apr  8 20:12:02 2002] 13:VALUE
                    513: [Mon Apr  8 20:12:02 2002]  "xxxx" string
                    514: [Mon Apr  8 20:12:02 2002] 14:GET_ELEMENT
                    515: [Mon Apr  8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
                    516: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
1.35      paf       517: [Mon Apr  8 20:12:02 2002]  "||"'469617+=24 VString -> 0 !optimize[6]'
1.32      paf       518: [Mon Apr  8 20:12:02 2002] <-ja returned
                    519: [Mon Apr  8 20:12:02 2002] ja->
                    520: 
                    521: 201/328=0.612804878049 %%optimized
                    522: 
                    523: 1.
                    524: CREATE_*POOL
                    525:     сделать
                    526: *POOL_POOLED+CODE
                    527:     где
                    528:         wwrapper
                    529:         и(возможно) wcodeframe
                    530:         +string
                    531:         стековая переменная
                    532: 
                    533: 2.
                    534: избавиться от обёртки при возврате результата process [см. тело _for]
                    535: 
                    536: 3.
                    537: сделать callback для process, чтобы вынести invariants из _for & co.
                    538: 
                    539: 4.
                    540:  @todo склеить get_element и write_value (при вставлении? write_value)
                    541: 
                    542: 5.
                    543: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
                    544: обёртка сразу выбрасывается = не нужна]
                    545: 
                    546: 6.
                    547: process вариант получить именно string, без VString обёртки [часто обёртка
                    548: сразу выбрасывается = не нужна]
                    549: 
                    550: 7.
                    551: string head, убить 8 байт неправильной link
1.31      paf       552: 
                    553: @voidparams[]
                    554: ^voidparamsm[$form:field]
                    555: 
                    556: @voidparamsm[p]
                    557: ^p.int(123)
1.29      paf       558: 
1.30      paf       559: @rolls2[]
                    560: $now[^date::now[]]
                    561: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
                    562: ^for[i](1;12){
                    563:        ^d.roll[month](-1) ^d.sql-string[]<br>
                    564: }
                    565: 
1.29      paf       566: @cacheexpireschanging[]
                    567: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
                    568:     ^cache[^date::now(+4/24/60/60)]
                    569: #    ^cache(2)
1.30      paf       570: #    ^cache(0)
1.29      paf       571:        ^math:random(100)
                    572: }
                    573: 
                    574: 
                    575: 
                    576: @cacheexpiresfixed[]
                    577: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
                    578:        ^math:random(100)
                    579: }
                    580: 
                    581: @dateoffsets[]
                    582: $d[^date::create(^date::now[]+1/24/60)]
                    583: #$d[^date::now(+1/24/60)]
                    584: ^d.sql-string[]
                    585: #$d
1.26      paf       586: 
1.28      paf       587: @exceptionTypes[]
                    588: #    parser.compile       ^test[}                компиляция (непарная скобка, ...)
                    589: #    parser.runtime       ^if(0).                параметры (больше/меньше, чем нужно, не тех типов, ...)
                    590: #    number.zerodivision  ^eval(1/0) ^eval(1%0)
                    591: #    number.format        ^eval(abc*5)
                    592: #    file.missing         ^file:delete[delme]                       not found
                    593: #    file.access          ^table::load[.]                       no rights
                    594: #    image.format         ^image::measure[index.html]                        not gif/jpg
                    595: #    sql.connect          ^connect[mysql://baduser:pass@host/db]{}                       not found/timeout
                    596: #    sql.execute          ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}}                       syntax error
                    597: #    xml                  ^xdoc::create{<forgot?>}                       any error in xml/xslt libs
                    598: #    smtp.connect                                not found/timeout
                    599: #    smtp.execute                                communication error
                    600: 
1.26      paf       601: @roll2[]
                    602: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27      paf       603: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26      paf       604: 
1.25      paf       605: 
                    606: @rolls[]
                    607: $d[^date::create(2002;4;4)]
                    608: ^d.sql-string[]<br>
                    609: ^for[i](1;7){
                    610: ^d.roll[day](-1)
                    611: ^d.sql-string[]<br>
                    612: }
                    613: <hr>
                    614: $d[^date::create(2002;3;28)]
                    615: ^d.sql-string[]<br>
                    616: ^for[i](1;7){
                    617: ^d.roll[day](+1)
                    618: ^d.sql-string[]<br>
                    619: }
                    620: <hr>
                    621: $d[^date::create(2002;12;3)]
                    622: ^d.sql-string[]<br>
                    623: ^for[i](1;14){
                    624: ^d.roll[day](-1)
                    625: ^d.sql-string[]<br>
                    626: }
                    627: <hr>
                    628: $d[^date::create(2002;10;19)]
                    629: ^d.sql-string[]<br>
                    630: ^for[i](1;14){
                    631: ^d.roll[day](+1)
                    632: ^d.sql-string[]<br>
                    633: }
                    634: 
                    635: 
                    636: 
                    637: 
                    638: 
1.22      paf       639: 
                    640: @exceptions1[]
                    641: ^try{
                    642:        aaa
1.24      paf       643:        ^throw[custom1;paf;is stupid]
1.22      paf       644: }{
1.24      paf       645:        ^if($exception.type eq custom1){
1.28      paf       646: #              $exception.handled(1)
                    647:        ^throw[$exception]
1.24      paf       648:                type=$exception.type<br>
                    649:            source=$exception.source<br>
                    650:            file=$exception.file<br>
                    651:            lineno=$exception.lineno<br>
                    652:        comment=$exception.comment<br>
                    653:        }
1.22      paf       654: }
1.21      paf       655: 
                    656: @locate_by_expr[]
                    657: $t[^table::create{a    b
                    658: 1      nok
                    659: 2      ok
                    660: 3      nok
                    661: }]
                    662: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17      paf       663: 
                    664: @method_junction_params[param]
                    665: ^if($param is junction){junction}{ne junction}
                    666: 
                    667: @verifyCookie[value] 
                    668: ^if($cookie:dummyvote eq $value){ 
                    669:        $result(1) 
                    670: }{ 
                    671:        $cookie:dummyvote[$value] 
                    672:        $result(0) 
                    673: }
1.16      paf       674: 
                    675: @execlangs[]
1.20      paf       676: $f[^file::exec[test.pl]]
1.36      paf       677: err:$f.stderr<br>
1.16      paf       678: ^process{$f.text}
                    679: #$c[^t.columns[]]
                    680: #^c.menu{
                    681: #* $c.column<br>
                    682: #}
1.36      paf       683: c:$t.c<br>
1.16      paf       684: 
                    685: @tobjeresult[]
                    686: ^table::create{a
                    687: 12}
1.15      paf       688: 
                    689: @xmlprobs[]
                    690: $xmlDataType[^xdoc::load[program.xml]]
                    691: #<pre>^taint[^xmlDataType.string[]]
                    692: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
                    693: #=^xmlDataTypes._count[]=
                    694: =^xmlDataTypes.0.getAttribute[type-id]=
                    695: 
                    696: @doubleprobs[]
                    697: $1(^math:radians(180))
                    698: $2($math:PI)
                    699: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
                    700: ^if($1==$2){y;n}
                    701: ^if(^math:radians(180)==$math:PI){y;n}
                    702: 
                    703: 
                    704: @divnamestop[]
                    705: $a(10)
                    706: ^eval($a\3)
                    707: 
                    708: @arrayclone[]
                    709: $t[^table::create{a    b
                    710: 1      11
                    711: 2      22
                    712: }]
                    713: $c[^table::create[$t]]
                    714: ^c.append{2    33}
                    715: ^t.count[]
                    716: ^c.count[]
                    717: 
                    718: @operator_tricks[]
                    719: ^if(1){$a[^t[]]}
                    720: $a!
                    721: $a($b)
                    722: ^if(1){y}{n}
                    723: $MAIN:a(^t[] eq OK)
                    724: #$MAIN:a(1)
                    725: ^if($a){y}{n}
                    726: #^if(1){y}{n}
                    727: $form:if
                    728: $a[$.n[1]]
                    729: $a.if
                    730: 
                    731: @xoutputrusattr[]
                    732: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
                    733: ^show_xdoc2[$d]
                    734: 
                    735: @xdocset1[]
                    736: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
                    737: ^show_xdoc2[$d]
                    738: 
                    739: @regexp3[]
                    740: $s[abcАБВ]
                    741: ^if(^s.match[][i]){y}{n}
                    742: 
                    743: 
                    744: @exec2[]
                    745: $a[^file::exec[bin/t.cmd]]
                    746: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
                    747: 
                    748: 
                    749: @tlock[]
                    750: ^file:lock[lockfile]{
                    751:        code
                    752: }
                    753: 
                    754: @xmloutattrwithoutvalue[]
                    755: #$ORIGINS(1)
                    756: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
                    757: $doc[^doc.transform[global.xsl]]
                    758: =^taint[html][^doc.string[$.method[html]]]=
                    759: 
                    760: 
                    761: 
                    762: @precisionProblem[]
                    763: $a[123456789012345678901234567890]
                    764: $b(^a.double[])
                    765: ^b.format{%.20E}
                    766: <hr>
                    767: ^eval(2*2)
                    768: 
                    769: @xpath[]
                    770: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    771: <document><block><p>привет</p></block></document>
                    772: }]
                    773: #^show_xdoc2[$xdoc]
                    774: $node[^xdoc.selectSingle[/document/block/p]]
                    775: ^if(def $node){
                    776:        ^if($node is string){
                    777:                $node
                    778:        }{
                    779:        ^if($node is hash){
                    780:                ^node._count[]
                    781:        }{
                    782:                $node.nodeType
                    783:        }
                    784:        }
                    785: #$node.firstChild.nodeValue
                    786: }{
                    787:        node not found
                    788: }
                    789: 
                    790: 
                    791: @ttablesetlang[]
                    792: $a-tab-b[a     b
                    793: 1      2]
                    794: 
                    795: $t[^table::set{$a-tab-b}]
                    796: =$t.a=
                    797: <hr>
                    798: 
                    799: $t[^table::set[nameless]{^taint[$a-tab-b]}]
                    800: =$t.0=
                    801: <hr>
                    802: 
                    803: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
                    804: =$t.a=
                    805: 
                    806: #^t.append{1   2}
                    807: 
                    808: @mail3[]
                    809: ^mail:send[
                    810:        $.from[Александр Петросян <paf@design.ru>]
                    811:        $.to[Александр Петросян <paf@design.ru>]
                    812:        $.subject[проверка4]
                    813:        $.body[
                    814:                $.text[
                    815:                        $.content-type[$.value[text/plain] $.charset[windows-1251]]
                    816:                        $.body[проверка]
                    817:                ]
                    818:                $.attachment[
                    819:                        $.value[^file::load[text;index.html]]
                    820:                        $.file-name[привет всем.html]                   
                    821:                ]
                    822:        ]
                    823: ]
                    824: 
                    825: 
                    826: @ttime[]
                    827: $now[^date::now[]]
                    828: $now.hour:$now.minute
                    829: 
                    830: @tupper[]
                    831: $t[abcABCабвАБВ]
                    832: $t<br>
                    833: ^t.upper[]
                    834: 
                    835: @treplace[]
                    836: $copy-paste-clean[^table::set{a b
                    837: .      _
                    838: ,      _
                    839: +      _
                    840: &      _
                    841: ?      _
                    842: =      _}]
                    843: 
                    844: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
                    845: # почему-то этот replace роняет апач в 500 ошибку :(
                    846: #^cache_key.replace[$copy-paste-clean]
                    847: $test[abc]
                    848: ^test.save[$cache_key]saved<br>
                    849: $cache[^file:list[.;\.cache^$]]
                    850: ^file:delete[$cache_key]deleted($cache.name)<br>
                    851: 
                    852: 
                    853: 
                    854: @xslt2[]
                    855: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    856: <document><block><p>привет</p></block></document>
                    857: }]
                    858: ^show_xdoc2[$xdoc]
                    859: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
                    860: <hr>
                    861: 
                    862: 
                    863: @tcache2[]
                    864: ^cache[$DB_HOME/keyключ](2){
                    865:        ^math:random(100)
                    866: }
                    867: 
                    868: @ttaintuntaint[]
                    869: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
                    870: 
                    871: ]zz
                    872: <hr>
                    873: ^untaint[html]{1^taint[  ]2  3}
                    874: 
                    875: 
                    876: @tappend2[]
                    877: $t[^table::set{a       b}]^t.append{1  2}$t.a
                    878: 
                    879: @badvsnprintf[]
                    880: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
                    881: }
                    882: 
                    883: 
                    884: @badoracequoting[]
                    885: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
                    886: ^connect[$SQL.connect-string]{
                    887: ^void:sql{delete from paf}
                    888: ^void:sql{insert into paf values (1, '$form:text')}
                    889: $paf[^table::sql{select * from paf}]
                    890: ^paf.menu{
                    891:        $paf.id: ^untaint{$paf.block}<hr>
                    892: 
                    893: }
                    894: <hr>
                    895: 
                    896: 
                    897: ^rem{
                    898: $news[^table::sql{select description from news}[$.limit(3)]]
                    899: ^news.menu{
                    900:        ^untaint{$news.description}<hr>
                    901: 
                    902: }
                    903: <hr>
                    904: }
                    905: 
                    906: $tables[^table::sql{select table_name from user_tables}]
                    907: ^tables.menu{
                    908: $tables.table_name<br>
                    909: }
                    910: 
                    911: }
                    912: <hr>
                    913: $env:PATH
                    914: 
                    915: @badconstructors[]
                    916: $bred[^string::length[]]
                    917: $bred[^response::clear[]]
                    918: $bred[^int::int[]]
                    919: 
                    920: 
                    921: @xloadwrongtable[]
                    922: $constr[^xdoc::load[wrongtable.xml]]
                    923: ^show_xdoc2[$constr]
                    924: 
                    925: @xsetwrongtable[]
                    926: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
                    927: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                    928: 
                    929: 
                    930: @tablecolumnerror[]
                    931: $t[^table::set{a}]
                    932: $t.$a
                    933: 
                    934: @roll[]
                    935: #$date[^date::set(1970;1;2)]
                    936: #^date.roll[month](-1)
                    937: $date[^date::set(2038;1;1)]
                    938: ^date.roll[month](+1)
                    939: $date.year  $date.month  $date.day
                    940: 
                    941: @cookie2[]
                    942: #=$cookie:clientType[$.value[test]]=<br>
                    943: =$cookie:clientType=<br>
                    944: 
                    945: 
                    946: @tableset[]
                    947: $a[^table::set{a
                    948: 1
                    949: 2}]
                    950: ^eval(100\$a)
                    951: 
                    952: 
                    953: 
                    954: @zzz[]
                    955: 
                    956: 
                    957: $constructor[
                    958: <block1 name="main_srvr" type="0" label="Основное тело" />
                    959: <block2 name="main_srvr2" type="0" label="Основное тело" />
                    960: ]
                    961: 
                    962: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                    963: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                    964: 
                    965: $children[$constr.documentElement.childNodes]
                    966: ^if($children){
                    967: ^for[i](1;^children._count[]){
                    968:        $node[$children.$i]
                    969:        $node.nodeName<br>
                    970: }
                    971: }
                    972:    
                    973: 
                    974: @thashforeach3[]
                    975: $h[
                    976:        $.a[1] 
                    977:        $.b[2]
                    978: ]
                    979: $c[^table::set{a
                    980: ^h.foreach[key;value]{$value
                    981: }}]
                    982: $c.a
                    983: 
                    984: @thashforeach2[]
                    985: $h[
                    986:        $.a[1] 
                    987:        $.b[2]
                    988: ]
                    989: $c[
                    990: ^h.foreach[key;value]{
                    991:        $.$key[$value]
                    992: }
                    993: ]
                    994: $c.b
                    995: 
                    996: @thashforeach[]
                    997: $h[
                    998:        $.a[1] 
                    999:        $.b[2]
                   1000: ]
                   1001: ^h.foreach[key;value]{
                   1002:        $key=$value<br>
                   1003: }
                   1004: 
                   1005: @thashdelete[]
                   1006: $h[$.a[1] $.b[2]]
                   1007: was:<br>
                   1008: count=^h._count[] <br>
                   1009: b='$h.b' <br>
                   1010: 
                   1011: ^h.delete[b] 
                   1012: 
                   1013: now:<br>
                   1014: count=^h._count[] <br>
                   1015: b='$h.b' 
                   1016: 
                   1017: @sappend[]
                   1018: $test[123]
                   1019: ^test.save[test]
                   1020: ^test.save[append;test]
                   1021: 
                   1022: @tappend[]
                   1023: $test[^table::set{a    b
                   1024: a1     b1}]
                   1025: ^test.save[test]
                   1026: $test[^table::set{a    b
                   1027: a2     b2}]
                   1028: ^test.save[append;test]
                   1029: 
                   1030: 
                   1031: @tform[]
                   1032: ^if(def $form:new_file){y}{n}
                   1033: <form method="post" enctype="multipart/form-data">
                   1034: <input type="file" name="new_file" />
                   1035: <input type=submit>
                   1036: </input>
                   1037: 
                   1038: @formattest[]
                   1039: $size(15.124)
                   1040: 
                   1041: ^size.format{%.2f}
                   1042: 
                   1043: @filelist[]
                   1044: $html[^file:list[.;\.html^$]]
                   1045: ^html.menu{
                   1046:        $html.name<br>
                   1047: }
                   1048: <hr>
                   1049: 
                   1050: @безнадёжна_попытка_поправить_непоправимое[]
                   1051: $dom_from_disk[^xdoc::load[input.xml]]
                   1052: $dom_created_in_air[^xdoc::create[doc]]
                   1053: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
                   1054: ^show_xdoc2[$dom_created_in_air]
                   1055: 
                   1056: 
                   1057: @tcache[]
                   1058: #^hashfile:clear[cache]
                   1059: $code[^hashfile::open[$DB_HOME;cache]]
                   1060: ^code.cache[key](2){
                   1061:        ^math:random(100)
                   1062: #      ^code.delete[]
                   1063: }
                   1064: 
                   1065: @thashfileexp[]
                   1066: $hf[^hashfile::open[$DB_HOME;hashfile]]
                   1067: $hf.paf[$.value[крут] $.expires(3)]
                   1068: paf=$hf.paf
                   1069: <hr>
                   1070: ^hf.foreach[key;value]{
                   1071:        $key=$value<br>
                   1072: }
                   1073: <hr>
                   1074: $hash[^hf.hash[]]
                   1075: =$hash.paf=
                   1076: <hr>
                   1077: 
                   1078: @tcounter[]
                   1079: ^tcounterone[$DB_HOME]
                   1080: other root:
                   1081: ^tcounterone[${DB_HOME}2]
                   1082: again, first:
                   1083: ^tcounterone[$DB_HOME]
                   1084: 
                   1085: @tcounterone[DB_HOME]
                   1086: $counter[^hashfile::open[$DB_HOME;counter]]
                   1087: #^counter.clear[]
                   1088: ^counter.transaction{
                   1089: #      $counter.value(10)
                   1090:        $counter.value($counter.value+1)
                   1091: #      ^counter.delete[value]
                   1092:        $counter.value
                   1093: }
                   1094: <hr>
                   1095: ^rem{
                   1096: $hash[^counter.hash[]]
                   1097: =$hash.value=
                   1098: <hr>
                   1099: }
                   1100: 
                   1101: @tablehash[]
                   1102: $productList[^table::set{id    name
                   1103: 1      носки
                   1104: 2      валенки
                   1105: 3      ушанка
                   1106: }]
                   1107: 
                   1108: #скажем, у первого дилера
                   1109: $firstPriceList[^table::set{id price
                   1110: 1      0.3
                   1111: 3      1000
                   1112: }]
                   1113: 
                   1114: $firstPriceHash[^firstPriceList.hash[id]]
                   1115: 
                   1116: ^productList.menu{
                   1117:     продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
                   1118: }
                   1119: 
                   1120: 
                   1121: @hashfile[]
                   1122: $hf[^hashfile::assign[hashfile]]
                   1123: #$hf.paf[крут5]
                   1124: paf=$hf.paf
                   1125: 
                   1126: @formclass[]
                   1127: ^$form:CLASS.a=$form:CLASS.a
                   1128: 
                   1129: @domdata[]
                   1130: ^if(1){
                   1131: #      $a{^hren[]}
                   1132: }
                   1133: $a
                   1134: $xdoc[^xdoc::create[doc]]
                   1135: $doc[$xdoc.documentElement]
                   1136: $name[^doc.appendChild[^xdoc.createElement[name]]]
                   1137: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
                   1138: ^untaint[as-is]{=$text.nodeValue=}
                   1139: 
                   1140: @domedit[]
                   1141: ^domdata[]
                   1142: #$paf.nodeName<br>
                   1143: #$doc.documentElement.nodeName<br>
                   1144: 
                   1145: ^show_xnode1[$xdoc.documentElement;0;1]
                   1146: <hr>
                   1147: ^show_xdoc2[$xdoc]
                   1148: <hr>
                   1149: 
                   1150: @domxslt[]
                   1151: ^domdata[]
                   1152: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
                   1153: <hr>
                   1154: 
                   1155: @lsplit2[]
                   1156: $path[/optics/]
                   1157: $pathTable[^path.lsplit[/]]
                   1158: ^pathTable.menu{
                   1159:        ^if(def $pathTable.piece){
                   1160:                =$pathTable.piece=
                   1161:        }
                   1162: }
                   1163: 
                   1164: 
                   1165: @faceesize[]
                   1166: $k(2)
                   1167: $pict[^image::load[paf.gif]]
                   1168: $small[^image::create($pict.width/$k;$pict.height/$k)]
                   1169: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
                   1170: $response:body[^small.gif[]]
                   1171: 
                   1172: @imageresize[]
                   1173: $k(2)
                   1174: $pict[^image::create(400*$k;200*$k)]
                   1175: $pict.line-width(2)
                   1176: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                   1177: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
                   1178: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                   1179: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
                   1180: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
                   1181: $response:body[^pict.gif[]]
                   1182: 
                   1183: #$small[^image::create($pict.width/$k;$pict.height/$k)]
                   1184: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
                   1185: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
                   1186: 
                   1187: #$response:body[^small.gif[]]
                   1188: 
                   1189: 
                   1190: @tintdefault[]
                   1191: #$abc[abc]
                   1192: $abc[33]
                   1193: ^abc.int[z]
                   1194: #^abc.int(123)
                   1195: 
                   1196: @ifassignhash[]
                   1197: $h[^if(1){$.a(1);$.a(2)}]
                   1198: $h.a
                   1199: 
                   1200: @ifpasshash[]
                   1201: $a[$.e[a]]
                   1202: $b[$.e[b]]
                   1203: ^ifpasshashdest[^if(1){$a;$b}]
                   1204: #$x[^if(1){$a}{$b}]
                   1205: #^ifpasshashdest[$x]
                   1206: 
                   1207: @ifpasshashdest[p]
                   1208: $p.e
                   1209: 
                   1210: @movedir[]
                   1211: ^file:move[a;deeper/a]
                   1212: 
                   1213: @replace[]
                   1214: $a[12^;3]
                   1215: ^a.replace[^table::set{from    to
                   1216: 2^;    !
                   1217: }]
                   1218: 
                   1219: 
                   1220: @set[]
                   1221: ^setdata[]
                   1222: ^a.add[$b]
                   1223: add:$a.3<br>
                   1224: 
                   1225: ^setdata[]
                   1226: ^a.sub[$b]
                   1227: sub2:$a.2<br>
                   1228: sub1:$a.1<br>
                   1229: 
                   1230: ^setdata[]
                   1231: $c[^a.union[$b]]
                   1232: union3:$c.3<br>
                   1233: union2:$c.2<br>
                   1234: 
                   1235: ^setdata[]
                   1236: $c[^a.intersection[$b]]
                   1237: intersection3:$c.3<br>
                   1238: intersection2:$c.2<br>
                   1239: 
                   1240: ^setdata[]
                   1241: intersects:^if(^a.intersects[$b]){y;n}<br>
                   1242: intersects2:^if(^a.intersects[ ]){y;n}<br>
                   1243: 
                   1244: 
                   1245: <hr>
                   1246: 
                   1247: @setdata[]
                   1248: $a[$.1[a1] $.2[a2]]
                   1249: $b[        $.2[b2] $.3[b3]]
                   1250: 
                   1251: 
                   1252: @hash[]
                   1253: $h[^hash::create[$._default[123]]]
                   1254: $h.paf[not kretin]
                   1255: $h.paf<br>
                   1256: =$h.that=<br>
                   1257: 
                   1258: @methresult[]
                   1259: $result[^table::set{1}]
                   1260: 
                   1261: @terror[]
                   1262: ^error[method z must be called with z]
                   1263: 
                   1264: @syntax1[]
                   1265: #^a[^b]
                   1266: 
                   1267: @syntax2[]
                   1268: #^a[
                   1269: 
                   1270: @ssave[]
                   1271: $abc[abc]
                   1272: ^abc.save[abc]
                   1273: 
                   1274: @calendar[]
                   1275: 2001;11:<br>
                   1276: $week_days[^date:calendar[rus](2001;11)]
                   1277: <pre>
                   1278: ^week_days.menu{^for[wday](0;7){^if($week_days.$wday){$week_days.$wday;&nbsp^;&nbsp^;} }<br>}
                   1279: </pre>
                   1280: 
                   1281: @thash[]
                   1282: $table[^table::set{id  name    age
                   1283: 1      paf     278
                   1284: 2      пиф     234
                   1285: }]
                   1286: $hash[^table.hash[id;^table::set[nameless]{id
                   1287: name}]]
                   1288: $hash.2.id $hash.2.name $hash.2.age
                   1289: 
                   1290: @tdef[]
                   1291: $s[0]
                   1292: if 0=^if($s){}{n}<br>
                   1293: if def 0=^if(def $s){y}{}<br>
                   1294: <hr>
                   1295: 
                   1296: @ford[]
                   1297: ^for[i](0;5){$i}{($i)}
                   1298: 
                   1299: @tif[]
                   1300: ^if[def]{y;n}
                   1301: 
                   1302: @image[]
                   1303: $pict[^image::create(400;200)]
                   1304: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                   1305: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
                   1306: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                   1307: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
                   1308: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
                   1309: $response:body[^pict.gif[]]
                   1310: 
                   1311: 
                   1312: 
                   1313: @mail2[]
                   1314: ^mail:send[
                   1315:        $.content-type[$.value[text/plain] $.charset[windows-1251]]
                   1316:        $.from[Александр Петросян <paf@design.ru>]
                   1317:        $.to[Александр Петросян <paf@design.ru>]
                   1318:        $.subject[проверка]
                   1319:        $.body[проверка]
                   1320: ]
                   1321: 
                   1322: @cookie[]
                   1323: $env:HTTP_COOKIE<br>
                   1324: 
                   1325: #$cookie:переменная[test тест ТЕСТ2]
                   1326: =$cookie:переменная=<br>
                   1327: #$cookie:переменная2[test тест ТЕСТ3]
                   1328: =$cookie:переменная2=<br>
                   1329: =$cookie:CLASS.переменная2=<br>
                   1330: 
                   1331: @response[]
                   1332: #^if($form:reload){
                   1333:        $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
                   1334: #}
                   1335: 
                   1336: @xslt[]
                   1337: ^xdata[]
                   1338: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
                   1339: ^show_xdoc2[$transformed]
                   1340: 
                   1341: @regexp2[]
                   1342: $s[  select]
                   1343: $s[^s.match[^^\s*][]{!}]
                   1344: $s
                   1345: 
                   1346: @header[]
                   1347: $response:refresh[
                   1348:        $.value[0]
                   1349:        $.url[http://design.ru?a=^taint[123]]
                   1350: ]
                   1351: 
                   1352: @ttablerem[]
                   1353: $table[^table::load[a.cfg]]
                   1354: ^table.menu{$table.a}
                   1355: 
                   1356: @tconnect[]
                   1357: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
                   1358: $tables[^table::sql{show tables}]
                   1359: #$cols[^tables.columns[]]
                   1360: #$cols.column
                   1361: ^tables.menu{
                   1362:        $tables.[Tables_in_test]<br>
                   1363: }
                   1364: }
                   1365: 
                   1366: @pcre[]
                   1367: $s[1 2]
                   1368: ^s.match[\s;ig]{!}
                   1369: #^s.match[\d;ig]{!}
                   1370: 
                   1371: 
                   1372: @regexp[]
                   1373: $s[abcАБВ]
                   1374: ^if(^s.match[б][i]){y}{n}
                   1375: 
                   1376: @mail[]
                   1377: #$ORIGINS(1)
                   1378: ^mail:send[
                   1379:        $.from[paf@design.ru]
                   1380:        $.to[paf@design.ru]
                   1381:        $.body[1
                   1382:        
                   1383:        2
                   1384:        
                   1385:        
                   1386:                3]
                   1387: ]
                   1388: 
                   1389: @exec[]
                   1390: $a[^file::exec[fc.exe;;a;b]]
                   1391: $a.status|$a.stderr<hr>
                   1392: 
                   1393: @fori[][i]
                   1394: ^for[i](1;3){... =$i= ...}
                   1395: 
                   1396: @xdata0[]
                   1397: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                   1398: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                   1399: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                   1400: <people>
                   1401:        <man id="1" имя="word слово">
                   1402:                <name>P&#171^;AF        B</name>
                   1403:        </man>
                   1404:                <man id="2">
                   1405:                        <name>ПИФ^taint[&]</name>
                   1406:                </man>
                   1407: </people>
                   1408: }]
                   1409: 
                   1410: @xdata[]
                   1411: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                   1412: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                   1413: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                   1414: <people>
                   1415:        <man id="1" имя="word слово">
                   1416:                <name>P&#171^;AF        B</name>
                   1417:        </man>
                   1418:                <man id="2">
                   1419:             <name>ПИФ^taint[&]</name>
                   1420:                </man>
                   1421: </people>
                   1422: }}]
                   1423: 
                   1424: @xml[]
                   1425: ^xdata[]
                   1426: 
                   1427: ^show_xdoc2[$xdoc]<hr>
                   1428: #^show_xnode1[$xdoc]<hr>
                   1429: $people[^xdoc.select[*/man]]
                   1430: #^show1[]
                   1431: ^show_xnodes1[$people]<hr>
                   1432: #^people.0.owner.hren[]
                   1433: 
                   1434: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
                   1435: 
                   1436: by id:
                   1437: ^show_xnode1[^xdoc.getElementById[1];0;1]
                   1438: <hr>
                   1439: 
                   1440: @show1[array]
                   1441: ^for[i](0;^array._count[]-1){
                   1442:     $x[$array.$i]
                   1443:        $x.firstChild.nodeValue: 
                   1444:                $pattributes[$x.parentNode.attributes]
                   1445:                ^if(^pattributes._count[]){
                   1446:                        $pattributes.id.name=$pattributes.id.nodeValue
                   1447:                }
                   1448:        <br>
                   1449: }
                   1450:        
                   1451: @show_xnodes1[array][i]
                   1452: ^for[i](0;^array._count[]-1){
                   1453:        ^show_xnode1[$array.$i;0;1]
                   1454: }
                   1455: 
                   1456: @show_xnode1[x;level;single][l]
                   1457: ^if(def $x){
                   1458:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}
                   1459:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1460:        &lt^;$x.nodeName
                   1461:            $pairs[$x.attributes]
                   1462:            ^if(def $pairs){
                   1463:                $names[^pairs._keys[]]
                   1464:                ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
                   1465:            }
                   1466:            &gt^;
                   1467:     }{
                   1468:        [$x.nodeType]
                   1469:     }
                   1470:     
                   1471:     ^if(def $x.nodeValue){$x.nodeValue}<br>
                   1472:     ^show_xnode1[$x.firstChild]($level+1)
                   1473:     ^if(!$single){
                   1474:            ^show_xnode1[$x.nextSibling]($level)
                   1475:     }
                   1476: 
                   1477:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1478:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}&lt^;/$x.nodeName&gt^;<br>
                   1479:     }
                   1480: }
                   1481: 
                   1482: @show_xdoc2[xdoc]
                   1483: ^xdoc.save[out/save.xml;
                   1484: #      $.encoding[utf-8]
                   1485:        $.method[xml]
                   1486: ]
                   1487: $file[^xdoc.file[
                   1488:        $.encoding[utf-8]
                   1489:        $.method[html]
                   1490: ]]
                   1491: ^file.save[text;out/save_file.html]
                   1492: #$response:body[^xdoc.file[    $.media-type[text/paf]  ]]
                   1493: <pre>^taint[html][^xdoc.string[
                   1494:        $.method[html]
                   1495: #      $.encoding[utF-8]
                   1496: #      $.omit-xml-declaration[yes]
                   1497: #      $.standalone[no]
                   1498: #      -$.doctype-public[-//W3C//DTD XHTML]
                   1499: #      -$.doctype-system[/a/b/c/]
                   1500: #      $.indent[yes]
                   1501: #      $.media-type[text/paf]
                   1502: ]]
                   1503: </pre>

E-mail: