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

1.61      paf         1: #@USE
                      2: #t.p
1.15      paf         3: 
1.72      paf         4: @auto[filespec]
                      5: $selffilespec[$filespec]
1.63      paf         6: #$form:here
1.84      paf         7: #$request:charset[UTF-8]
                      8: #$response:charset[windows-1251]
                      9: #$response:content-type[$.value[text/html]$.charset[$response:charset]]
1.15      paf        10: 
1.60      paf        11: #@postprocess[body]
                     12: #<b>$body</b>
                     13: #$result[123]
1.37      paf        14: 
1.15      paf        15: @main[]
1.72      paf        16: #$a(123)
                     17: #^a.format[%.10u]
1.71      paf        18: #$result[111]
1.70      paf        19: #^f[a]
1.97      paf        20: #^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
1.88      paf        21: #      ^int:sql{select news_id from news where news_id=-1}[
                     22: ##     $.default{2}
                     23: #      ]<br>
                     24: #    ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
1.95      paf        25: #      ^file::load[text;^string:sql{select '^^hello[]' }]
                     26: #      ^string:sql{select '^^hello[]' }] $ORIGINS(1)
1.96      paf        27: #      ^process{       ^^h[]}
1.97      paf        28: #      ^process{^string:sql{select '1
                     29: #      ^^hello[]' }]   }
                     30: #}
1.49      paf        31: #^eval(2)
1.48      paf        32: #^tcrashlocaljunctionsv2[]
1.49      paf        33: #^tcrashlocaljunctions[]
1.50      paf        34: #^tjunctions[]
1.47      paf        35: #^replacetest[]
1.48      paf        36: #^matchoptionpp[]
1.46      paf        37: #^txdocxnodechild[]
1.44      paf        38: #^tclasses[]
1.43      paf        39: #$math:PI
                     40: #^b:method[]
1.42      paf        41: #^main[]
1.41      paf        42: #^errort[]
1.44      paf        43: #^tselectNumber[]
1.39      paf        44: #$result[hello]
1.36      paf        45: #^invaliddate2[]
                     46: #^process2[]
                     47: #^casehashtext[]
1.35      paf        48: #^subjvaltest[]
                     49: #^tableselect0[]
1.34      paf        50: #^memnotest1[]
1.32      paf        51: #^voidparams[]
1.31      paf        52: #^rolls2[]
1.30      paf        53: #^cacheexpireschanging[]
1.29      paf        54: #^cacheexpiresfixed[]
                     55: #^dateoffsets[]
                     56: #^exceptionTypes[]
1.28      paf        57: #^roll2[]
1.27      paf        58: #^rolls[]
1.25      paf        59: #^exceptions1[]
1.22      paf        60: #^locate_by_expr[]
1.18      paf        61: #^method_junction_params{...}
1.17      paf        62: #^verifyCookie[paf]
1.37      paf        63: #^execlangs[]
1.16      paf        64: #$t[^tobjeresult[]]$t.a
                     65: #^xmlprobs[]
1.15      paf        66: #^doubleprobs[]
                     67: #^math:random(-10)
                     68: #^divnamestop[]
                     69: #^arrayclone[]
                     70: #^operator_tricks[]
                     71: #^xoutputrusattr[]
                     72: #^xdocset1[]
                     73: #^regexp3[]
                     74: #^exec2[]
                     75: #^tlock[]
                     76: #^xmloutattrwithoutvalue[]
                     77: #^precisionProblem[]
                     78: #^xpath[]
                     79: #^ttablesetlang[]
                     80: #^ttime[]
                     81: #^tupper[]
                     82: #^treplace[]
                     83: #^xslt2[]
                     84: #^tcache2[]
                     85: #$ORIGINS(1)
                     86: #$t[^table::set{a b} ^table::set{c d}]
                     87: #^ttaintuntaint[]
                     88: #^tappend2[]
                     89: #^badvsnprintf[]
                     90: #^badoracequoting[]
                     91: #^badconstructors[]
                     92: #^xloadwrongtable[]
                     93: #^xsetwrongtable[]
                     94: #^if($form:test){y}{n}
                     95: #^tablecolumnerror[]
                     96: #^roll[]
                     97: #^cookie2[]
                     98: #^tableset[]
                     99: #^math:PI.format{%.30f}
                    100: #^xchildren[]
                    101: #^thashforeach3[]
                    102: #^thashforeach2[]
                    103: #^thashforeach[]
                    104: #^thashdelete[]
                    105: #^connect[mysql://user:pass@cd.rinet.ru/db]{^void:sql{z} }
                    106: #^tappend[]
                    107: #^sappend[]
                    108: #^eval(10\3)<br>
                    109: #^tform[]
                    110: #^formattest[]
                    111: #^filelist[]
                    112: #^connect[mysql://user:pass@host]{ }
                    113: #^безнадёжна_попытка_поправить_непоправимое[]
                    114: #^tcache[]
                    115: #^thashfileexp[]
                    116: #^tcounter[]
                    117: #^tablehash[]
                    118: #j^hashfile[]
                    119: #^formclass[]
                    120: #^hren[]
                    121: #^domedit[]
                    122: #^domxslt[]
                    123: #^lsplit2[]
                    124: #^faceesize[]
                    125: #^imageresize[]
                    126: #^ifassignhash[]
                    127: #^tintdefault[]
                    128: #$response:status[404]
                    129: #^ifpasshash[]
                    130: #^movedir[]
                    131: #^replace[]
                    132: #^set[]
                    133: #^hash[]<hr>
                    134: #$t[^methresult[]] ->$t
                    135: #^terror[]
                    136: #^ssave[]
                    137: #^thash[]
                    138: #^tdef[]
                    139: #^ford[]
                    140: #^tif[]
1.84      paf       141: #^image[]
1.15      paf       142: #^mail2[]
                    143: #^cookie[]
                    144: #^response[]
                    145: #^regexp2[]
                    146: #^ttablerem[]
                    147: #^pcre[]
                    148: #^regexp[]<hr>
                    149: #^mail[]
                    150: #^exec[]
                    151: #^fori[]
                    152: #^tconnect[]
                    153: #^xslt[]
                    154: #^xml[]
                    155: #^header[]
1.53      paf       156: #^tablehasht[]
1.54      paf       157: #^datecreatestring[]
1.56      paf       158: #^mssqltypes1[]
                    159: #^badthrows[]
1.57      paf       160: #^xmlspace[]
                    161: #^counter[main.counter]
                    162: #^xpath2[]
                    163: #^callindirect[]
                    164: #^junctionprob[]
1.59      paf       165: #^datecreatestring2[]
                    166: #^tstoredproc[]
                    167: #^tstoredproc2[]
                    168: #^forkeys[]
1.60      paf       169: #^pngsize[]
1.61      paf       170: #^checkList[]
1.63      paf       171: #^datetest[]
1.65      paf       172: #^tserge[]
1.69      paf       173: #^envt[]
1.67      paf       174: #^selectt[]
                    175: #^select2[]
                    176: #^selectSingle2[]
                    177: #^selectString2[]
                    178: #^selectNumber2[]
                    179: #^selectBool2[]
                    180: #^xdoccreate[]
                    181: #^xdoccreatetag[]
1.70      paf       182: #^xdocload[]
1.67      paf       183: #^xdocstring[]
                    184: #^xdocsave[]
1.68      paf       185: #^div[]
                    186: #^datecreatestring3[]
1.73      paf       187: #^tfilespec[]
1.77      paf       188: #^tcrypt[]
1.74      paf       189: #^cryptdocsample[]
1.78      paf       190: #^tnormalize[]
1.83      paf       191: #^xmltransformbyxdoc[]
1.81      paf       192: #^sergestrandef[]
1.83      paf       193: #^tstdin[]
                    194: #^tfind[]
1.86      paf       195: #^mimet[]
1.88      paf       196: #^cgit[]
1.92      paf       197: #^joinlimit[]
1.89      paf       198: #^tableclonelimit[]
1.91      paf       199: #^transparams[]
                    200: #^sendtests[]
1.93      paf       201: #^wwrapperpass[]
1.95      paf       202: #^badpos[]
1.98      paf       203: #^processtest[]
                    204: #^mail3[]
1.99      paf       205: #^mail4[]
1.100     paf       206: #^datesaving[]
1.101     paf       207: #^badconstructor[]
1.103   ! paf       208: #^calendar[]
        !           209: ^monthdays(8)
1.77      paf       210: <hr>
1.74      paf       211: OK
1.100     paf       212: 
1.103   ! paf       213: @monthdays[month]
        !           214: $from[^date::create(2000;$month;1)]
        !           215: $to[^date::create($from)] ^to.roll[month](+1)
        !           216: $result($to-$from)
        !           217: 
1.100     paf       218: @badconstructor[]
                    219: ^date::now[]
1.99      paf       220: 
                    221: @datesaving[]
                    222: $now[^date::now[]]
                    223: $now.daylightsaving<br>
                    224: $now.yearday<br>
                    225: #
                    226: $date[^date::create(2002;1;3)]
                    227: $date.daylightsaving<br>
                    228: $date.yearday
1.97      paf       229: 
1.98      paf       230: @mail4[]
                    231: ^mail:send[
                    232:        $.from[paf@mail.design.ru]
                    233:        $.to[paf@mail.design.ru]
                    234:        $.subject[^taint[uri][москва]=2]
                    235:        $.text[^taint[uri][москва]=]
                    236:        $.html{<a href=http://there.ru/?city=^taint[uri][Москва]>link</a>}
                    237: ]
1.97      paf       238: @processtest[]
                    239:     $f[^file::load[text;piece.p]]      ^process{$f.text}
                    240:        $ORIGINS(1)
1.93      paf       241: 
                    242: 
                    243: @badpos[]
                    244: $s[123]
1.94      paf       245: ^s.mid(0;2)
1.92      paf       246: 
                    247: @wwrapperpass[]
                    248: $h[^hash::create[]]
                    249: $h.a(1)
                    250: ^my_method[^if(1){$h}]
                    251: работает. так и должно быть?
                    252: 
                    253: @my_method[p]
                    254: ^p._count[]
                    255: 
1.88      paf       256: 
                    257: @tableclonelimit[]
                    258: $source[^table::create{a
                    259: aa
                    260: bb
                    261: cc}]
                    262: ^source.offset(1)
                    263: #$dest[^table::create[$source]]
                    264: $dest[^table::create[$source;$.offset(2)]]
                    265: $dest[^table::create[$source;$.limit(2)]]
                    266: $dest[^table::create[$source;$.offset(1)$.limit(1)]]
                    267: $dest[^table::create[$source;$.offset(1)$.limit(2)]]
                    268: $dest[^table::create[$source;$.offset[cur]$.limit(2)]]
                    269: 
                    270: ^dest.menu{$dest.a}[,]<br>
                    271: 
                    272: @joinlimit[]
                    273: $source[^table::create{a
                    274: aa
                    275: bb
                    276: cc}]
                    277: ^source.offset(2)
                    278: $dest[^table::create{a
                    279: xx
                    280: }]
                    281: #^dest.join[$source]
                    282: #^dest.join[$source;$.offset(2)]
                    283: #^dest.join[$source;$.limit(2)]
                    284: #^dest.join[$source;$.offset(1)$.limit(1)]
                    285: #^dest.join[$source;$.offset(1)$.limit(2)]
1.91      paf       286: #^dest.join[$source;$.offset[cur]$.limit(1)]
                    287: ^dest.join[$source;$.limit(0)]
1.88      paf       288: 
                    289: ^dest.menu{$dest.a}[,]<br>
1.86      paf       290: 
                    291: @cgit[]
                    292: $f[^file::cgi[showenv.cmd]]
                    293: $f.HELLO=<br>
                    294: $f.CONTENT-TYPE=<br>
                    295: $f.content-type=<br>
                    296: 
1.83      paf       297: 
1.84      paf       298: @mimet[]
1.85      paf       299: $f[^file::stat[a.GIF]]
                    300: $f.content-type
1.84      paf       301: 
                    302: 
1.83      paf       303: @tfind[]
                    304: ^file:find[index.html]
                    305: 
                    306: @tstdin[]
                    307: $f[^file::exec[test.pl;$.stdin[проверка stdin потока]]]
                    308: <pre>$f.text</pre>
1.80      paf       309: 
                    310: @sergestrandef[]
                    311: $sQuantity[ ]
                    312: ^sQuantity.int(10)
1.78      paf       313: 
                    314: @xmltransformbyxdoc[]
                    315: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                    316: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                    317: <people>
                    318:        <man id="1" имя="word слово">
                    319:                <name>1  2</name>
                    320:        </man>
                    321: </people>
                    322: }}]
                    323: $sheet[^xdoc::create{<?xml version="1.0"?> 
1.79      paf       324: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
                    325: 
                    326: >
1.78      paf       327: <!--<xsl:output doctype-public ="-//W3C//DTD XHTML" indent="yes"/>-->
                    328: 
1.79      paf       329:        <!--<xsl:import href="http://localhost/html.xsl"/>-->
                    330:        <xsl:import href="html.xsl"/>
                    331: 
1.78      paf       332: <xsl:param name="param1">defparam1</xsl:param>
                    333: <xsl:param name="param2">defparam2</xsl:param>
1.79      paf       334: 
1.78      paf       335: 
                    336:        <xsl:template match="doc">
                    337:                param1=<xsl:value-of select="^$param1"/><br/>
                    338:                param2=<xsl:value-of select="^$param2"/><br/>
                    339: 
                    340:                test return <something background=""/>
                    341:        </xsl:template>
                    342: 
                    343:        <xsl:template name="test">
1.81      paf       344:                test return3
1.78      paf       345:        </xsl:template>
                    346: 
                    347:   <xsl:template match="people">
                    348:      <html>
                    349:      <head>z</head>
                    350:                para1=<xsl:copy-of select="^$param1"/>
                    351:        <xsl:apply-templates/>
                    352:        <hr/>
                    353:        <xsl:call-template name="test"/>
                    354:      </html>   
                    355:   </xsl:template>
                    356: 
                    357:   <xsl:template match="name">
                    358:     <b><xsl:value-of select="."/></b>
                    359:   </xsl:template>
                    360: </xsl:stylesheet>
                    361: }]
                    362: 
                    363: 
                    364: $xdoc[^xdoc.transform[$sheet]]
                    365: $string[^xdoc.string[$.method[html]]]
                    366: ^string.save[a]
                    367: ^untaint[html]{$string}
                    368: 
                    369: 
1.77      paf       370: 
                    371: @tnormalize[]
                    372: #s состоит из 1000 фрагментов
                    373: $s[^for[i](0;999){фрагмент }]
                    374: #это займет много ресурсов
                    375: ^s.match[фраг][g]{перга}
                    376: #это займет меньше ресурсов
                    377: #$normalized[^s.normalize[]]
                    378: #^normalized.match[фраг][g]{перга}
1.74      paf       379: 
                    380: @sendtests[]
1.89      paf       381: ^text[]
1.74      paf       382: #^html[]
                    383: #^text-n-html[]
                    384: #^file[]
                    385: #^text-n-file[]
1.89      paf       386: #^text-n-html-n-file[]
1.74      paf       387: #^backwardcomp[]
                    388: 
                    389: @backwardcomp[]
                    390: ^mail:send[
                    391:        $.from[paf]
                    392:        $.to[paf]
                    393:        $.body[this is text value]
                    394: ]
                    395: 
                    396: @text[]
                    397: ^mail:send[
                    398:        $.from[paf]
1.90      paf       399:        $.to[paf]
1.74      paf       400:        $.text[
                    401:                $.value[this is text value]
                    402:        ]
                    403: ]
                    404: 
                    405: @html[]
                    406: ^mail:send[
                    407:        $.from[paf]
                    408:        $.to[paf]
                    409:        $.html{this is <b>html</b> value ^taint[<] 10}
                    410: ]
                    411: 
                    412: @text-n-html[]
                    413: ^mail:send[
                    414:        $.from[paf]
                    415:        $.to[paf]
                    416:        $.text[
                    417:                $.value[this is text value]
                    418:        ]
                    419:        $.html[
                    420:        $.value{this is <b>html</b> value ^taint[<] 10}
                    421:        ]
                    422: ]
                    423: 
                    424: @file[]
                    425: ^mail:send[
                    426:        $.from[paf]
                    427:        $.to[paf]
                    428:        $.file[^file::load[binary;image.jpg]]
                    429: ]
                    430: 
                    431: @text-n-file[]
                    432: ^mail:send[
                    433:        $.from[paf]
                    434:        $.to[paf]
                    435:        $.text[
                    436:                $.value[this is text value]
                    437:        ]
                    438:        $.file[^file::load[binary;image.jpg]]
                    439: ]
                    440: 
                    441: @text-n-html-n-file[]
                    442: ^mail:send[
                    443:        $.from[paf]
                    444:        $.to[paf]
                    445:        $.text[
                    446:                $.value[this is text value]
                    447:        ]
                    448:        $.html[
                    449:        $.COntent-type[$.value[text/html]$.charset[windows-1251xx]]
                    450:        $.value{this is <b>html</b> value ^taint[<] 10}
                    451:        ]
                    452:        $.file[^file::load[binary;image.jpg]]
                    453: ]
                    454: 
                    455: 
                    456: 
                    457: @md5salt[]
                    458: 1234
                    459: 
                    460: @cryptdocsample[]
                    461: $users[^table::create{name     password
                    462: alice  ***
                    463: bob    ***
                    464: }]
                    465: 
                    466: $htpasswd[^table::create[nameless]{}]
                    467: ^users.menu{
                    468:        ^htpasswd.append{$users.name:^math:crypt[$users.password;^$apr1^$^md5salt[]]}
                    469: }
                    470: 
                    471: ^htpasswd.save[nameless;.htpasswd-parser-test]
                    472: 
1.73      paf       473: 
                    474: @tcrypt[]
1.76      paf       475: #^math:crypt[123;^$apr1^$1234567890abcdef]<br>
                    476: ^math:crypt[123;^$apr1^$]<br>
1.72      paf       477: 
                    478: @tfilespec[]
                    479: src=$selffilespec<br>
                    480: dirname=^file:dirname[$selffilespec]<br>
                    481: basename=^file:basename[$selffilespec]<br>
                    482: justname=^file:justname[$selffilespec]<br>
                    483: justext=^file:justext[$selffilespec]<br>
1.68      paf       484: 
                    485: @datecreatestring3[]
                    486: $new_after[^date::now(-3)]
                    487: $articles[^table::create{id    title   last_update
                    488: 1      привет  2002-07-03}]
                    489: ^articles.menu{
                    490:     $last_update[^date::create[$articles.last_update]]
                    491:     <a href=${articles.id}.html>$articles.title</a>
                    492:     ^if($last_update > $new_after){новая}
                    493:     <br>
                    494: }
1.67      paf       495: 
                    496: @div[]
                    497: $var(5)
                    498: ^var.inc(7)
                    499: ^var.dec(3)
                    500: ^var.div(4)
                    501: ^var.mul(2)
                    502: $var
                    503: 
                    504: 
                    505: @xdocsave[]
                    506: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
                    507: <document>
                    508: строка1<br/>
                    509: строка2<br/>
                    510: </document>}]
                    511: ^document.save[test.xml]
                    512: 
                    513: @xdocstring[]
                    514: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
                    515: <document>
                    516: строка1<br/>
                    517: строка2<br/>
                    518: </document>}]
                    519: ^document.string[
                    520:     $.method[html]
                    521: ]
                    522: 
                    523: 
                    524: @xdocload[]
                    525: $document[^xdoc::load[article.xml]]
                    526: $response:body[^document.file[$.media-type[text/xml]]]
                    527: 
                    528: 
                    529: @xdoccreatetag[]
                    530: $document[^xdoc::create[document]]
                    531: $paraNode[^document.createElement[para]]
                    532: $dummy[^document.documentElement.appendChild[$paraNode]]
                    533: $response:body[^document.file[$.media-type[text/xml]]]
                    534: 
                    535: 
                    536: @xdoccreate[]
                    537: $document[^xdoc::create{<?xml version="1.0" encoding="windows-1251" ?>
                    538: <document>
                    539: текст
                    540: </document>}]
                    541: $response:body[^document.file[$.media-type[text/xml]]]
                    542: 
                    543: @selectBool2[]
                    544: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                    545: <t attr="привет" n="123"/>}]
                    546: ^if(^d.selectBool[/t/@n > 10]){
                    547:     /t/@n больше 10
                    548: }{
                    549:     не больше
                    550: }
                    551: 
                    552: 
                    553: @selectNumber2[]
                    554: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                    555: <t attr="привет" n="123"/>}]
                    556: ^d.selectNumber[number(/t/@n)+1]<br>
                    557: ^d.selectNumber[2*2]<br>
                    558: 
                    559: 
                    560: @selectString2[]
                    561: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                    562: <t attr="привет" n="123"/>}]
                    563: # результат=привет
                    564: ^d.selectString[string(t/@attr)]
                    565: 
                    566: 
                    567: @selectSingle2[]
                    568: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                    569: <t attr="привет" n="123"/>}]
                    570: # результат=один элемент "t"
                    571: $element[^d.selectSingle[t]]
                    572: # результат=2 (количество атрибутов <t>)
                    573: Количество атрибутов: ^element.attributes._count[]<br>
                    574: # результат=не существует (нет <x>)
                    575: ^if(^d.select[x]){
                    576:     x существует
                    577: }{
                    578:     x не существует
                    579: }
                    580: 
                    581: @select2[]
                    582: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
                    583: # результат: список из одного элемента "t"
                    584: $list[^d.select[t]]
                    585: # результат: 2 = количество атрибутов <t>
                    586: ^list.0.attributes._count[]<br>
                    587: ^for[i](0;$list-1){
                    588:     $attr[$list.$i]
                    589:     $attr.nodeName = $attr.nodeType<br>
                    590: }
                    591: 
                    592: 
                    593: @selectt[]
                    594: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><t attr="привет" n="123"/>}]
                    595: $list[^d.select[t]]
                    596: ^list.0.attributes._count[]
1.65      paf       597: 
                    598: @envt[]
1.66      paf       599: $f[^file::exec[showenv.cmd;
                    600:        $.bad[value]
                    601:        $.CGI_good[value]
                    602: ]]
1.65      paf       603: $f.status<br>
                    604: $f.stderr<br>
                    605: <pre>$f.text</pre>
                    606: 
1.63      paf       607: 
                    608: @tserge[]
1.64      paf       609: ^if(" 09 "){y}
1.61      paf       610: 
                    611: @datetest[]
                    612:        $f[^file::stat[some.zip]]
                    613: Размер в байтах: $f.size<br>
                    614: Год создания: $f.cdate.year<br>
                    615: $now[^date::now[]]
                    616: $DAYS_CONSIDERED_NEW(3)
                    617: Статус: ^if($f.mdate >= $now-$DAYS_CONSIDERED_NEW){новый;старый}
                    618: 
1.60      paf       619: 
                    620: @checkList[]
                    621: ...^oneOf[a;a,b,c]...<br>
                    622: #...^oneOf[a;ax,b,c]...<br>
                    623: ...^oneWord[word]...<br>
                    624: #...^oneWord[wo rd]...<br>
                    625: 
                    626: 
                    627: @oneOf[s;list][t] выдаёт строку, если строка она есть в списке(разделенном запятыми)
                    628: $t[^list.lsplit[,]]
                    629: ^if(!^t.locate[piece;$s]){^throw[user;$s;unknown]}
                    630: $result[$s]
                    631: 
                    632: @oneWord[s]
                    633: ^if(^s.match[\W]){^throw[user.data;$s;not word]}{$s}
1.59      paf       634: 
                    635: @pngsize[]
                    636: $i[^image::measure[test.png]]
                    637: ^i.html[]
                    638: 
                    639: 
                    640: @forkeys[]
                    641: $text[^form:fields.foreach[key;val]{$key=$val
                    642: }]
                    643: ^text.save[ttt.txt]
                    644: =$text=
                    645: 
                    646: 
                    647: @tstoredproc2[]
                    648: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
                    649:        ^void:sql{exec pafvoid}
                    650: }
                    651: 
                    652: @tstoredproc[]
                    653: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
                    654:        $t[^table::sql{exec pafproc}]
                    655: #      $t[^table::sql{{call pafproc}}]
                    656:        $c[^t.columns[]]
                    657:        ^c.menu{$c.column}[<br>]
                    658: }
1.57      paf       659: 
                    660: @datecreatestring2[]
1.58      paf       661: <table border=1>
                    662: ^datecreatestring2show[2000]
                    663: ^datecreatestring2show[2000-02]
1.59      paf       664: ^datecreatestring2show[2000-2-03]
1.58      paf       665: ^datecreatestring2show[2000-02-03 15]
                    666: ^datecreatestring2show[2000-02-03 15:30] 
                    667: ^datecreatestring2show[2000-02-03 15:30:04] 
                    668: ^datecreatestring2show[2000-02-03 15:30:04 hren] 
                    669: ^datecreatestring2show[15:30] 
                    670: ^datecreatestring2show[15:30:05] 
                    671: ^datecreatestring2show[15:30:05 hren] 
                    672: </table>
                    673: 
                    674: @datecreatestring2show[s]
                    675: $date[^date::create[$s]]
                    676: <tr>
                    677: <td>$s</td><td align=right>^date.sql-string[]</td>
                    678: </tr>
                    679: 
1.57      paf       680: 
                    681: @junctionprob[][l]
                    682: $l[123]
                    683: $a{$l}
                    684: ^junctionprobnested[$a]
                    685: @junctionprobnested[p]
                    686: $p
                    687: 
                    688: 
                    689: @callindirecttarget[]
                    690: callindirecttarget called
                    691: @callindirect[]
                    692: $f[$callindirecttarget]
                    693: ^f[]
                    694: 
                    695: @xpath2[]
                    696: $xdoc[^xdoc::create{<?xml version="1.0" encoding="windows-1251"?>
                    697: <doc>
                    698: <field-list>
                    699: <field name="aa"/>
                    700: <field name="bb"/>
                    701: </field-list>
                    702: </doc>
                    703: }]
                    704: 
                    705: #^xdoc.string[]
                    706: 
                    707: $fieldList[^xdoc.selectSingle[/doc/field-list]]
                    708: #^fieldList.childNodes._count[]
                    709: $fields[^fieldList.select[field]]
                    710: #^fields._count[]
                    711: ^fields.foreach[k;node]{
                    712:        $node.nodeName<br>
                    713: }
                    714: @counter[filespec][f;s]
                    715: ^file:lock[$filespec]{
                    716:        $f[^file::load[text;$filespec]]
                    717:        $s[^eval($f.text+1)]
                    718:        ^s.save[$filespec]      
                    719: }
                    720: $s
1.56      paf       721: 
                    722: @xmlspace[]
                    723: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                    724: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                    725: <people>
                    726:        <man id="1" имя="word слово">
                    727:                <name>1  2</name>
                    728:        </man>
                    729: </people>
                    730: }}]
                    731: $xdoc[^xdoc.transform[global.xsl]]
                    732: $string[^xdoc.string[$.method[html]]]
                    733: ^string.save[a]
                    734: ^untaint[html]{$string}
                    735: 
                    736: @badthrows[]
                    737: #^throw[a;b;]
                    738: ^throw[a;]
1.54      paf       739: 
                    740: @mssqltypes1[]
                    741: ^connect[odbc://DSN=nestle^;UID=nestle^;PWD=mbm32]{
1.55      paf       742: #    ^string:sql{select { ts '1998-05-02 01:23:56.123' }}
                    743: #    ^string:sql{select CAST({ ts '1998-05-02 01:23:56.123' }AS smalldatetime)}
                    744: #      ^string:sql{select CAST({ts '2002-04-28 00:00:00.000'} AS smalldatetime)}
                    745:        $t[^table::sql{select a from paf}]
                    746:        ^t.count[]
1.54      paf       747: }
1.51      paf       748: 
1.53      paf       749: @datecreatestring[]
1.54      paf       750: $d[^date::create[2002-04-33 01:03:04]]
1.53      paf       751: ^d.sql-string[]
1.52      paf       752: 
                    753: @method[hash]
                    754: $hash.key
                    755: @mainZ[]
                    756: ^method[
                    757:     $.key{code}
                    758: ]
                    759: 
1.51      paf       760: @tablehasht[]
                    761: $t[^table::create{p
                    762: 1
                    763: 3
                    764: 2
                    765: 4}]
                    766: 
                    767: $h[^t.hash[p]]
                    768: 
                    769: =^h._count[]=
                    770: 
                    771: 
                    772: @sqldefaults[]
                    773: ^connect[mysql://mdm:4b833ljq@db-mysql/mdm]{
                    774:        ^int:sql{select news_id from news where news_id=-1}[$.default{2}]<br>
                    775:     ^string:sql{select news_id from news where news_id=-1}[$.default{2}]
                    776: }
1.60      paf       777: =======
                    778: <hr>
                    779: OK
                    780: >>>>>>> 1.50
1.48      paf       781: 
                    782: @tcrashlocaljunctionsv2[]
                    783: $a[
                    784:        $b{  $c[1] }
                    785: ]
                    786: $b
                    787: $c
                    788: 
                    789: @tcrashlocaljunctions[]
                    790: $var[aaa]
                    791: ^if(1){
                    792: ^tcrashlocaljunctions1[]
                    793: }
                    794: 
                    795: $j
                    796: 
1.49      paf       797: @tcrashlocaljunctions1[][var]
                    798: $var[varvalue]
1.48      paf       799:        $j{
                    800:                $var
                    801:        }
1.49      paf       802: $j
1.48      paf       803: 
                    804: @tjunctions[][tl]
                    805: $t[^t::create[]]
                    806: ^tjunctionsi[]
                    807: 
                    808: @tjunctionsi[][tl]
                    809: $tl[12345]
                    810: ^t.tjunctionsm[
                    811:        $.key{
                    812:                $tl
                    813:        }
                    814: ]
1.46      paf       815: 
1.47      paf       816: @replacetest[]
                    817: $b[b]
                    818: $s[
                    819: aaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    820: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa${b}aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    821: ]
                    822: ^s.replace[^table::create{from to
                    823: ba     !_}]
                    824: 
                    825: 
1.46      paf       826: @matchoptionpp[]
1.47      paf       827: #$ORIGINS(1)
1.46      paf       828: $s[
                    829: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.47      paf       830: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    831: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    832: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    833: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    834: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    835: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    836: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    837: aaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                    838: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
1.46      paf       839: ]
                    840: ^s.match[b;g']{($match.prematch|$match.match|$match.postmatch)}
                    841: 
1.44      paf       842: 
                    843: @txdocxnodechild[]
                    844: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?><d/>}]
                    845: $xdoc.nodeName
                    846: ^xdoc.selectNumber[2*2]
1.45      paf       847: $xdoc:ELEMENT_NODE
1.44      paf       848: 
                    849: 
                    850: @tclasses[]
                    851: $t[^t::create[]]
                    852: ^t.method[]
                    853: <hr>
                    854: ^t.base_method[]
                    855: 
1.40      paf       856: 
                    857: @errort[]
1.42      paf       858: ^xdoc::create[a]
1.40      paf       859: #^throw[user;here;this]
                    860: 
                    861: @tselectNumber[]
                    862: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет" n="123"/>}]
                    863: ^d.selectString[string(d/@attr)]<br>
                    864: ^d.selectNumber[2*2]<br>
                    865: ^d.selectNumber[number(/d/@n)+1]<br>
                    866: 
1.34      paf       867: 
1.36      paf       868: @invaliddate2[]
                    869: $d[^date::create(1018946575/60/60)] ^d.sql-string[]
                    870: 
                    871: @process2[]
                    872: ^^process{
                    873:        ^process{
                    874:                ^$a[^^if(0){^$.k[y]}{^$.k[^^hren[]n]}] ^$a.k
                    875:        }
                    876: }
                    877: 
1.35      paf       878: @casehashtext[]
                    879: $tt[1]
                    880: $tmp[
                    881:         ^switch[$tt]{
                    882:                 ^case[1]{
                    883:                         $.aaa[123]
                    884:                 }
                    885:                 ^case[DEFAULT]{
                    886:                         $.bbb[456]
                    887:                 }
                    888:         }
1.36      paf       889:         shit!
1.35      paf       890: ]
1.36      paf       891: #$tmp
1.35      paf       892: $tmp.aaa
                    893: 
                    894: @subjvaltest[]
                    895: $a12[val]
                    896: $b[12]
                    897: $a$b
                    898: 
1.34      paf       899: @tableselect0[]
                    900: $person[^table::create{name    height
                    901: paf    1.77
                    902: шохин  2.07
                    903: moko   1.77
                    904: }]
                    905: $nottoohigh[^person.select($person.height<2)]
                    906: ^nottoohigh.menu{$nottoohigh.name<br>}
1.32      paf       907: 
                    908: @transparams[]
                    909: $idoc[^xdoc::create{<?xml version="1.0" ?><doc/>}]
                    910: $odoc[^idoc.transform[global.xsl;
                    911:        $.param1['1']
                    912:        $.param2['2']
                    913: ]]
                    914: <pre>^taint[^odoc.string[$.method[html]]]
                    915: 
                    916: @memnotest1[]
                    917: ^for[i](0;4000){
                    918: 
                    919:  $xxxx[$i]
                    920:  $xxxx
                    921: 
                    922: }
                    923: 
                    924: @memnotest1notes[]
                    925: одна итерация цикла:
                    926: [Mon Apr  8 20:12:02 2002] execution-------------------------|
1.35      paf       927: '469641+=28 wcodeframe -> 0 !optimize[3]''469669+=49 string от {} -> 0 optimize[3]'
1.32      paf       928: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
                    929: [Mon Apr  8 20:12:02 2002]  "|| "
                    930: [Mon Apr  8 20:12:02 2002] 12:WITH_ROOT
                    931: [Mon Apr  8 20:12:02 2002] 13:VALUE
                    932: [Mon Apr  8 20:12:02 2002]  "xxxx" string
1.35      paf       933: [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       934: [Mon Apr  8 20:12:02 2002] 16:WITH_READ
                    935: [Mon Apr  8 20:12:02 2002] 17:VALUE
                    936: [Mon Apr  8 20:12:02 2002]  "i" string
                    937: [Mon Apr  8 20:12:02 2002] 18:GET_ELEMENT
1.35      paf       938: [Mon Apr  8 20:12:02 2002] 17:WRITE_VALUE'469452+=40 MAX_NUMBER -> !~2 actual digits''469492+=49 -> 41 !'
                    939: [Mon Apr  8 20:12:02 2002] 16:REDUCE_EWPOOL'469541+=24 VString -> 0 optimize[5]'
1.32      paf       940: [Mon Apr  8 20:12:02 2002] 15:CONSTRUCT_VALUE
                    941: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
                    942: [Mon Apr  8 20:12:02 2002]  "| "
                    943: [Mon Apr  8 20:12:02 2002] 12:WITH_READ
                    944: [Mon Apr  8 20:12:02 2002] 13:VALUE
                    945: [Mon Apr  8 20:12:02 2002]  "xxxx" string
                    946: [Mon Apr  8 20:12:02 2002] 14:GET_ELEMENT
                    947: [Mon Apr  8 20:12:02 2002] 13:WRITE_VALUE'469573+=41 string expand nothing for now'
                    948: [Mon Apr  8 20:12:02 2002] 12:STRING__WRITE
1.35      paf       949: [Mon Apr  8 20:12:02 2002]  "||"'469617+=24 VString -> 0 !optimize[6]'
1.32      paf       950: [Mon Apr  8 20:12:02 2002] <-ja returned
                    951: [Mon Apr  8 20:12:02 2002] ja->
                    952: 
                    953: 201/328=0.612804878049 %%optimized
                    954: 
                    955: 1.
                    956: CREATE_*POOL
                    957:     сделать
                    958: *POOL_POOLED+CODE
                    959:     где
                    960:         wwrapper
                    961:         и(возможно) wcodeframe
                    962:         +string
                    963:         стековая переменная
                    964: 
                    965: 2.
                    966: избавиться от обёртки при возврате результата process [см. тело _for]
                    967: 
                    968: 3.
                    969: сделать callback для process, чтобы вынести invariants из _for & co.
                    970: 
                    971: 4.
                    972:  @todo склеить get_element и write_value (при вставлении? write_value)
                    973: 
                    974: 5.
                    975: reduce_*pool -> вариант получить именно string, без VString обёртки [часто
                    976: обёртка сразу выбрасывается = не нужна]
                    977: 
                    978: 6.
                    979: process вариант получить именно string, без VString обёртки [часто обёртка
                    980: сразу выбрасывается = не нужна]
                    981: 
                    982: 7.
                    983: string head, убить 8 байт неправильной link
1.31      paf       984: 
                    985: @voidparams[]
                    986: ^voidparamsm[$form:field]
                    987: 
                    988: @voidparamsm[p]
                    989: ^p.int(123)
1.29      paf       990: 
1.30      paf       991: @rolls2[]
                    992: $now[^date::now[]]
                    993: $d[^date::create($now.year;$now.month)] ^d.sql-string[]<br>
                    994: ^for[i](1;12){
                    995:        ^d.roll[month](-1) ^d.sql-string[]<br>
                    996: }
                    997: 
1.29      paf       998: @cacheexpireschanging[]
                    999: ^cache[$DB_HOME/keyключ][^date::now(+1)]{ ^rem{1 day}
                   1000:     ^cache[^date::now(+4/24/60/60)]
                   1001: #    ^cache(2)
1.30      paf      1002: #    ^cache(0)
1.29      paf      1003:        ^math:random(100)
                   1004: }
                   1005: 
                   1006: 
                   1007: 
                   1008: @cacheexpiresfixed[]
                   1009: ^cache[$DB_HOME/keyключ][^date::now(+2/24/60/60)]{
                   1010:        ^math:random(100)
                   1011: }
                   1012: 
                   1013: @dateoffsets[]
                   1014: $d[^date::create(^date::now[]+1/24/60)]
                   1015: #$d[^date::now(+1/24/60)]
                   1016: ^d.sql-string[]
                   1017: #$d
1.26      paf      1018: 
1.28      paf      1019: @exceptionTypes[]
                   1020: #    parser.compile       ^test[}                компиляция (непарная скобка, ...)
                   1021: #    parser.runtime       ^if(0).                параметры (больше/меньше, чем нужно, не тех типов, ...)
                   1022: #    number.zerodivision  ^eval(1/0) ^eval(1%0)
                   1023: #    number.format        ^eval(abc*5)
                   1024: #    file.missing         ^file:delete[delme]                       not found
                   1025: #    file.access          ^table::load[.]                       no rights
                   1026: #    image.format         ^image::measure[index.html]                        not gif/jpg
                   1027: #    sql.connect          ^connect[mysql://baduser:pass@host/db]{}                       not found/timeout
                   1028: #    sql.execute          ^connect[mysql://okuser:pass@host/db]{^void:sql{select bad}}                       syntax error
                   1029: #    xml                  ^xdoc::create{<forgot?>}                       any error in xml/xslt libs
                   1030: #    smtp.connect                                not found/timeout
                   1031: #    smtp.execute                                communication error
                   1032: 
1.26      paf      1033: @roll2[]
                   1034: $d[^date::create(2002;4;2;2;2;3)] ^d.sql-string[]<br>
1.27      paf      1035: ^d.roll[day](+365*3+1) ^d.sql-string[]<br>
1.26      paf      1036: 
1.25      paf      1037: 
                   1038: @rolls[]
                   1039: $d[^date::create(2002;4;4)]
                   1040: ^d.sql-string[]<br>
                   1041: ^for[i](1;7){
                   1042: ^d.roll[day](-1)
                   1043: ^d.sql-string[]<br>
                   1044: }
                   1045: <hr>
                   1046: $d[^date::create(2002;3;28)]
                   1047: ^d.sql-string[]<br>
                   1048: ^for[i](1;7){
                   1049: ^d.roll[day](+1)
                   1050: ^d.sql-string[]<br>
                   1051: }
                   1052: <hr>
                   1053: $d[^date::create(2002;12;3)]
                   1054: ^d.sql-string[]<br>
                   1055: ^for[i](1;14){
                   1056: ^d.roll[day](-1)
                   1057: ^d.sql-string[]<br>
                   1058: }
                   1059: <hr>
                   1060: $d[^date::create(2002;10;19)]
                   1061: ^d.sql-string[]<br>
                   1062: ^for[i](1;14){
                   1063: ^d.roll[day](+1)
                   1064: ^d.sql-string[]<br>
                   1065: }
                   1066: 
                   1067: 
                   1068: 
                   1069: 
                   1070: 
1.22      paf      1071: 
                   1072: @exceptions1[]
                   1073: ^try{
                   1074:        aaa
1.24      paf      1075:        ^throw[custom1;paf;is stupid]
1.22      paf      1076: }{
1.24      paf      1077:        ^if($exception.type eq custom1){
1.28      paf      1078: #              $exception.handled(1)
                   1079:        ^throw[$exception]
1.24      paf      1080:                type=$exception.type<br>
                   1081:            source=$exception.source<br>
                   1082:            file=$exception.file<br>
                   1083:            lineno=$exception.lineno<br>
                   1084:        comment=$exception.comment<br>
                   1085:        }
1.22      paf      1086: }
1.21      paf      1087: 
                   1088: @locate_by_expr[]
                   1089: $t[^table::create{a    b
                   1090: 1      nok
                   1091: 2      ok
                   1092: 3      nok
                   1093: }]
                   1094: ^if(^t.locate($t.a==2)){$t.b}{n}
1.17      paf      1095: 
                   1096: @method_junction_params[param]
                   1097: ^if($param is junction){junction}{ne junction}
                   1098: 
                   1099: @verifyCookie[value] 
                   1100: ^if($cookie:dummyvote eq $value){ 
                   1101:        $result(1) 
                   1102: }{ 
                   1103:        $cookie:dummyvote[$value] 
                   1104:        $result(0) 
                   1105: }
1.16      paf      1106: 
                   1107: @execlangs[]
1.20      paf      1108: $f[^file::exec[test.pl]]
1.36      paf      1109: err:$f.stderr<br>
1.16      paf      1110: ^process{$f.text}
                   1111: #$c[^t.columns[]]
                   1112: #^c.menu{
                   1113: #* $c.column<br>
                   1114: #}
1.36      paf      1115: c:$t.c<br>
1.16      paf      1116: 
                   1117: @tobjeresult[]
                   1118: ^table::create{a
                   1119: 12}
1.15      paf      1120: 
                   1121: @xmlprobs[]
                   1122: $xmlDataType[^xdoc::load[program.xml]]
                   1123: #<pre>^taint[^xmlDataType.string[]]
                   1124: $xmlDataTypes[^xmlDataType.select[programs/program[@id=4]/data]]
                   1125: #=^xmlDataTypes._count[]=
                   1126: =^xmlDataTypes.0.getAttribute[type-id]=
                   1127: 
                   1128: @doubleprobs[]
                   1129: $1(^math:radians(180))
                   1130: $2($math:PI)
                   1131: ^if(^1.format[%.10f]==^2.format[%.10f]){y;n}
                   1132: ^if($1==$2){y;n}
                   1133: ^if(^math:radians(180)==$math:PI){y;n}
                   1134: 
                   1135: 
                   1136: @divnamestop[]
                   1137: $a(10)
                   1138: ^eval($a\3)
                   1139: 
                   1140: @arrayclone[]
                   1141: $t[^table::create{a    b
                   1142: 1      11
                   1143: 2      22
                   1144: }]
                   1145: $c[^table::create[$t]]
                   1146: ^c.append{2    33}
                   1147: ^t.count[]
                   1148: ^c.count[]
                   1149: 
                   1150: @operator_tricks[]
                   1151: ^if(1){$a[^t[]]}
                   1152: $a!
                   1153: $a($b)
                   1154: ^if(1){y}{n}
                   1155: $MAIN:a(^t[] eq OK)
                   1156: #$MAIN:a(1)
                   1157: ^if($a){y}{n}
                   1158: #^if(1){y}{n}
                   1159: $form:if
                   1160: $a[$.n[1]]
                   1161: $a.if
                   1162: 
                   1163: @xoutputrusattr[]
                   1164: $d[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?><d attr="привет"/>}]
                   1165: ^show_xdoc2[$d]
                   1166: 
                   1167: @xdocset1[]
                   1168: $d[^xdoc::set{<?xml version="1.0"?><d>=^taint[&]=</d>}]
                   1169: ^show_xdoc2[$d]
                   1170: 
                   1171: @regexp3[]
                   1172: $s[abcАБВ]
                   1173: ^if(^s.match[][i]){y}{n}
                   1174: 
                   1175: 
                   1176: @exec2[]
                   1177: $a[^file::exec[bin/t.cmd]]
                   1178: <pre>^taint[$a.text]</pre>|$a.status|$a.stderr<hr>
                   1179: 
                   1180: 
                   1181: @tlock[]
                   1182: ^file:lock[lockfile]{
                   1183:        code
                   1184: }
                   1185: 
                   1186: @xmloutattrwithoutvalue[]
                   1187: #$ORIGINS(1)
                   1188: $doc[^xdoc::set{<?xml version="1.0"?><doc background="">zz</doc>}]
                   1189: $doc[^doc.transform[global.xsl]]
                   1190: =^taint[html][^doc.string[$.method[html]]]=
                   1191: 
                   1192: 
                   1193: 
                   1194: @precisionProblem[]
                   1195: $a[123456789012345678901234567890]
                   1196: $b(^a.double[])
                   1197: ^b.format{%.20E}
                   1198: <hr>
                   1199: ^eval(2*2)
                   1200: 
                   1201: @xpath[]
                   1202: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                   1203: <document><block><p>привет</p></block></document>
                   1204: }]
                   1205: #^show_xdoc2[$xdoc]
                   1206: $node[^xdoc.selectSingle[/document/block/p]]
                   1207: ^if(def $node){
                   1208:        ^if($node is string){
                   1209:                $node
                   1210:        }{
                   1211:        ^if($node is hash){
                   1212:                ^node._count[]
                   1213:        }{
                   1214:                $node.nodeType
                   1215:        }
                   1216:        }
                   1217: #$node.firstChild.nodeValue
                   1218: }{
                   1219:        node not found
                   1220: }
                   1221: 
                   1222: 
                   1223: @ttablesetlang[]
                   1224: $a-tab-b[a     b
                   1225: 1      2]
                   1226: 
                   1227: $t[^table::set{$a-tab-b}]
                   1228: =$t.a=
                   1229: <hr>
                   1230: 
                   1231: $t[^table::set[nameless]{^taint[$a-tab-b]}]
                   1232: =$t.0=
                   1233: <hr>
                   1234: 
                   1235: $t[^table::set{^untaint{^taint[$a-tab-b]}}]
                   1236: =$t.a=
                   1237: 
                   1238: #^t.append{1   2}
                   1239: 
                   1240: @mail3[]
                   1241: ^mail:send[
1.98      paf      1242:        $.from[Александр Петросян <paf@mail.design.ru>]
                   1243:        $.to[Александр Петросян <paf@mail.design.ru>]
                   1244:        $.subject[проверка2]
1.15      paf      1245:        $.body[
                   1246:                $.text[
                   1247:                        $.content-type[$.value[text/plain] $.charset[windows-1251]]
1.98      paf      1248:                        $.body[проверка^taint[uri][москва]=]
1.15      paf      1249:                ]
                   1250:                $.attachment[
                   1251:                        $.value[^file::load[text;index.html]]
                   1252:                        $.file-name[привет всем.html]                   
                   1253:                ]
                   1254:        ]
                   1255: ]
                   1256: 
                   1257: 
                   1258: @ttime[]
                   1259: $now[^date::now[]]
                   1260: $now.hour:$now.minute
                   1261: 
                   1262: @tupper[]
                   1263: $t[abcABCабвАБВ]
                   1264: $t<br>
                   1265: ^t.upper[]
                   1266: 
                   1267: @treplace[]
                   1268: $copy-paste-clean[^table::set{a b
                   1269: .      _
                   1270: ,      _
                   1271: +      _
                   1272: &      _
                   1273: ?      _
                   1274: =      _}]
                   1275: 
                   1276: $cache_key[^taint[в.а,с+я]&был?тут=недавно.cache]
                   1277: # почему-то этот replace роняет апач в 500 ошибку :(
                   1278: #^cache_key.replace[$copy-paste-clean]
                   1279: $test[abc]
                   1280: ^test.save[$cache_key]saved<br>
                   1281: $cache[^file:list[.;\.cache^$]]
                   1282: ^file:delete[$cache_key]deleted($cache.name)<br>
                   1283: 
                   1284: 
                   1285: 
                   1286: @xslt2[]
                   1287: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                   1288: <document><block><p>привет</p></block></document>
                   1289: }]
                   1290: ^show_xdoc2[$xdoc]
                   1291: ^show_xdoc2[^xdoc.transform[templates/_document.xslt]]
                   1292: <hr>
                   1293: 
                   1294: 
                   1295: @tcache2[]
                   1296: ^cache[$DB_HOME/keyключ](2){
                   1297:        ^math:random(100)
                   1298: }
                   1299: 
                   1300: @ttaintuntaint[]
                   1301: <!-- некий панковский заголовок с буковкой C в круглых скобках -->^taint[html][
                   1302: 
                   1303: ]zz
                   1304: <hr>
                   1305: ^untaint[html]{1^taint[  ]2  3}
                   1306: 
                   1307: 
                   1308: @tappend2[]
                   1309: $t[^table::set{a       b}]^t.append{1  2}$t.a
                   1310: 
                   1311: @badvsnprintf[]
                   1312: ^connect[zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz]{
                   1313: }
                   1314: 
                   1315: 
                   1316: @badoracequoting[]
                   1317: $SQL.connect-string[oracle://webspb:webpwd@mts?NLS_LANG=RUSSIAN_AMERICA.CL8MSWIN1251&NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS]
                   1318: ^connect[$SQL.connect-string]{
                   1319: ^void:sql{delete from paf}
                   1320: ^void:sql{insert into paf values (1, '$form:text')}
                   1321: $paf[^table::sql{select * from paf}]
                   1322: ^paf.menu{
                   1323:        $paf.id: ^untaint{$paf.block}<hr>
                   1324: 
                   1325: }
                   1326: <hr>
                   1327: 
                   1328: 
                   1329: ^rem{
                   1330: $news[^table::sql{select description from news}[$.limit(3)]]
                   1331: ^news.menu{
                   1332:        ^untaint{$news.description}<hr>
                   1333: 
                   1334: }
                   1335: <hr>
                   1336: }
                   1337: 
                   1338: $tables[^table::sql{select table_name from user_tables}]
                   1339: ^tables.menu{
                   1340: $tables.table_name<br>
                   1341: }
                   1342: 
                   1343: }
                   1344: <hr>
                   1345: $env:PATH
                   1346: 
                   1347: @badconstructors[]
                   1348: $bred[^string::length[]]
                   1349: $bred[^response::clear[]]
                   1350: $bred[^int::int[]]
                   1351: 
                   1352: 
                   1353: @xloadwrongtable[]
                   1354: $constr[^xdoc::load[wrongtable.xml]]
                   1355: ^show_xdoc2[$constr]
                   1356: 
                   1357: @xsetwrongtable[]
                   1358: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251z" ?>
                   1359: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                   1360: 
                   1361: 
                   1362: @tablecolumnerror[]
                   1363: $t[^table::set{a}]
                   1364: $t.$a
                   1365: 
                   1366: @roll[]
                   1367: #$date[^date::set(1970;1;2)]
                   1368: #^date.roll[month](-1)
                   1369: $date[^date::set(2038;1;1)]
                   1370: ^date.roll[month](+1)
                   1371: $date.year  $date.month  $date.day
                   1372: 
                   1373: @cookie2[]
                   1374: #=$cookie:clientType[$.value[test]]=<br>
                   1375: =$cookie:clientType=<br>
                   1376: 
                   1377: 
                   1378: @tableset[]
                   1379: $a[^table::set{a
                   1380: 1
                   1381: 2}]
                   1382: ^eval(100\$a)
                   1383: 
                   1384: 
                   1385: 
                   1386: @zzz[]
                   1387: 
                   1388: 
                   1389: $constructor[
                   1390: <block1 name="main_srvr" type="0" label="Основное тело" />
                   1391: <block2 name="main_srvr2" type="0" label="Основное тело" />
                   1392: ]
                   1393: 
                   1394: $constr[^xdoc::set{<?xml version="1.0" encoding="windows-1251" ?>
                   1395: <block-list>^untaint[as-is]{$constructor}</block-list>}]
                   1396: 
                   1397: $children[$constr.documentElement.childNodes]
                   1398: ^if($children){
                   1399: ^for[i](1;^children._count[]){
                   1400:        $node[$children.$i]
                   1401:        $node.nodeName<br>
                   1402: }
                   1403: }
                   1404:    
                   1405: 
                   1406: @thashforeach3[]
                   1407: $h[
                   1408:        $.a[1] 
                   1409:        $.b[2]
                   1410: ]
                   1411: $c[^table::set{a
                   1412: ^h.foreach[key;value]{$value
                   1413: }}]
                   1414: $c.a
                   1415: 
                   1416: @thashforeach2[]
                   1417: $h[
                   1418:        $.a[1] 
                   1419:        $.b[2]
                   1420: ]
                   1421: $c[
                   1422: ^h.foreach[key;value]{
                   1423:        $.$key[$value]
                   1424: }
                   1425: ]
                   1426: $c.b
                   1427: 
                   1428: @thashforeach[]
                   1429: $h[
                   1430:        $.a[1] 
                   1431:        $.b[2]
                   1432: ]
                   1433: ^h.foreach[key;value]{
                   1434:        $key=$value<br>
                   1435: }
                   1436: 
                   1437: @thashdelete[]
                   1438: $h[$.a[1] $.b[2]]
                   1439: was:<br>
                   1440: count=^h._count[] <br>
                   1441: b='$h.b' <br>
                   1442: 
                   1443: ^h.delete[b] 
                   1444: 
                   1445: now:<br>
                   1446: count=^h._count[] <br>
                   1447: b='$h.b' 
                   1448: 
                   1449: @sappend[]
                   1450: $test[123]
                   1451: ^test.save[test]
                   1452: ^test.save[append;test]
                   1453: 
                   1454: @tappend[]
                   1455: $test[^table::set{a    b
                   1456: a1     b1}]
                   1457: ^test.save[test]
                   1458: $test[^table::set{a    b
                   1459: a2     b2}]
                   1460: ^test.save[append;test]
                   1461: 
                   1462: 
                   1463: @tform[]
                   1464: ^if(def $form:new_file){y}{n}
                   1465: <form method="post" enctype="multipart/form-data">
                   1466: <input type="file" name="new_file" />
                   1467: <input type=submit>
                   1468: </input>
                   1469: 
                   1470: @formattest[]
                   1471: $size(15.124)
                   1472: 
                   1473: ^size.format{%.2f}
                   1474: 
                   1475: @filelist[]
                   1476: $html[^file:list[.;\.html^$]]
                   1477: ^html.menu{
                   1478:        $html.name<br>
                   1479: }
                   1480: <hr>
                   1481: 
                   1482: @безнадёжна_попытка_поправить_непоправимое[]
                   1483: $dom_from_disk[^xdoc::load[input.xml]]
                   1484: $dom_created_in_air[^xdoc::create[doc]]
                   1485: ^dom_created_in_air.documentElement.appendChild[^dom_from_disk.documentElement.cloneNode(1)]
                   1486: ^show_xdoc2[$dom_created_in_air]
                   1487: 
                   1488: 
                   1489: @tcache[]
                   1490: #^hashfile:clear[cache]
                   1491: $code[^hashfile::open[$DB_HOME;cache]]
                   1492: ^code.cache[key](2){
                   1493:        ^math:random(100)
                   1494: #      ^code.delete[]
                   1495: }
                   1496: 
                   1497: @thashfileexp[]
                   1498: $hf[^hashfile::open[$DB_HOME;hashfile]]
                   1499: $hf.paf[$.value[крут] $.expires(3)]
                   1500: paf=$hf.paf
                   1501: <hr>
                   1502: ^hf.foreach[key;value]{
                   1503:        $key=$value<br>
                   1504: }
                   1505: <hr>
                   1506: $hash[^hf.hash[]]
                   1507: =$hash.paf=
                   1508: <hr>
                   1509: 
                   1510: @tcounter[]
                   1511: ^tcounterone[$DB_HOME]
                   1512: other root:
                   1513: ^tcounterone[${DB_HOME}2]
                   1514: again, first:
                   1515: ^tcounterone[$DB_HOME]
                   1516: 
                   1517: @tcounterone[DB_HOME]
                   1518: $counter[^hashfile::open[$DB_HOME;counter]]
                   1519: #^counter.clear[]
                   1520: ^counter.transaction{
                   1521: #      $counter.value(10)
                   1522:        $counter.value($counter.value+1)
                   1523: #      ^counter.delete[value]
                   1524:        $counter.value
                   1525: }
                   1526: <hr>
                   1527: ^rem{
                   1528: $hash[^counter.hash[]]
                   1529: =$hash.value=
                   1530: <hr>
                   1531: }
                   1532: 
                   1533: @tablehash[]
                   1534: $productList[^table::set{id    name
                   1535: 1      носки
                   1536: 2      валенки
                   1537: 3      ушанка
                   1538: }]
                   1539: 
                   1540: #скажем, у первого дилера
                   1541: $firstPriceList[^table::set{id price
                   1542: 1      0.3
                   1543: 3      1000
                   1544: }]
                   1545: 
                   1546: $firstPriceHash[^firstPriceList.hash[id]]
                   1547: 
                   1548: ^productList.menu{
                   1549:     продукт "$productList.name" | цена у first: $firstPriceHash.[$productList.id].price<br>
                   1550: }
                   1551: 
                   1552: 
                   1553: @hashfile[]
                   1554: $hf[^hashfile::assign[hashfile]]
                   1555: #$hf.paf[крут5]
                   1556: paf=$hf.paf
                   1557: 
                   1558: @formclass[]
                   1559: ^$form:CLASS.a=$form:CLASS.a
                   1560: 
                   1561: @domdata[]
                   1562: ^if(1){
                   1563: #      $a{^hren[]}
                   1564: }
                   1565: $a
                   1566: $xdoc[^xdoc::create[doc]]
                   1567: $doc[$xdoc.documentElement]
                   1568: $name[^doc.appendChild[^xdoc.createElement[name]]]
                   1569: $text[^name.appendChild[^xdoc.createTextNode[петросян&coz]]]
                   1570: ^untaint[as-is]{=$text.nodeValue=}
                   1571: 
                   1572: @domedit[]
                   1573: ^domdata[]
                   1574: #$paf.nodeName<br>
                   1575: #$doc.documentElement.nodeName<br>
                   1576: 
                   1577: ^show_xnode1[$xdoc.documentElement;0;1]
                   1578: <hr>
                   1579: ^show_xdoc2[$xdoc]
                   1580: <hr>
                   1581: 
                   1582: @domxslt[]
                   1583: ^domdata[]
                   1584: ^show_xdoc2[^xdoc.transform[global.xsl;$.param1[123/]]]
                   1585: <hr>
                   1586: 
                   1587: @lsplit2[]
                   1588: $path[/optics/]
                   1589: $pathTable[^path.lsplit[/]]
                   1590: ^pathTable.menu{
                   1591:        ^if(def $pathTable.piece){
                   1592:                =$pathTable.piece=
                   1593:        }
                   1594: }
                   1595: 
                   1596: 
                   1597: @faceesize[]
                   1598: $k(2)
                   1599: $pict[^image::load[paf.gif]]
                   1600: $small[^image::create($pict.width/$k;$pict.height/$k)]
                   1601: ^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;250)
                   1602: $response:body[^small.gif[]]
                   1603: 
                   1604: @imageresize[]
                   1605: $k(2)
                   1606: $pict[^image::create(400*$k;200*$k)]
                   1607: $pict.line-width(2)
                   1608: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                   1609: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-20;$pict.height-20;0+20;360-20;0xff0000)
                   1610: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                   1611: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-20;0x0000ff)
                   1612: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+20;360-20;0xff0000)
                   1613: $response:body[^pict.gif[]]
                   1614: 
                   1615: #$small[^image::create($pict.width/$k;$pict.height/$k)]
                   1616: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0)
                   1617: #^small.copy[$pict](0;0;$pict.width;$pict.height;0;0;$small.width;$small.height;0)
                   1618: 
                   1619: #$response:body[^small.gif[]]
                   1620: 
                   1621: 
                   1622: @tintdefault[]
                   1623: #$abc[abc]
                   1624: $abc[33]
                   1625: ^abc.int[z]
                   1626: #^abc.int(123)
                   1627: 
                   1628: @ifassignhash[]
                   1629: $h[^if(1){$.a(1);$.a(2)}]
                   1630: $h.a
                   1631: 
                   1632: @ifpasshash[]
                   1633: $a[$.e[a]]
                   1634: $b[$.e[b]]
                   1635: ^ifpasshashdest[^if(1){$a;$b}]
                   1636: #$x[^if(1){$a}{$b}]
                   1637: #^ifpasshashdest[$x]
                   1638: 
                   1639: @ifpasshashdest[p]
                   1640: $p.e
                   1641: 
                   1642: @movedir[]
                   1643: ^file:move[a;deeper/a]
                   1644: 
                   1645: @replace[]
                   1646: $a[12^;3]
                   1647: ^a.replace[^table::set{from    to
                   1648: 2^;    !
                   1649: }]
                   1650: 
                   1651: 
                   1652: @set[]
                   1653: ^setdata[]
                   1654: ^a.add[$b]
                   1655: add:$a.3<br>
                   1656: 
                   1657: ^setdata[]
                   1658: ^a.sub[$b]
                   1659: sub2:$a.2<br>
                   1660: sub1:$a.1<br>
                   1661: 
                   1662: ^setdata[]
                   1663: $c[^a.union[$b]]
                   1664: union3:$c.3<br>
                   1665: union2:$c.2<br>
                   1666: 
                   1667: ^setdata[]
                   1668: $c[^a.intersection[$b]]
                   1669: intersection3:$c.3<br>
                   1670: intersection2:$c.2<br>
                   1671: 
                   1672: ^setdata[]
                   1673: intersects:^if(^a.intersects[$b]){y;n}<br>
                   1674: intersects2:^if(^a.intersects[ ]){y;n}<br>
                   1675: 
                   1676: 
                   1677: <hr>
                   1678: 
                   1679: @setdata[]
                   1680: $a[$.1[a1] $.2[a2]]
                   1681: $b[        $.2[b2] $.3[b3]]
                   1682: 
                   1683: 
                   1684: @hash[]
                   1685: $h[^hash::create[$._default[123]]]
                   1686: $h.paf[not kretin]
                   1687: $h.paf<br>
                   1688: =$h.that=<br>
                   1689: 
                   1690: @methresult[]
                   1691: $result[^table::set{1}]
                   1692: 
                   1693: @terror[]
                   1694: ^error[method z must be called with z]
                   1695: 
                   1696: @syntax1[]
                   1697: #^a[^b]
                   1698: 
                   1699: @syntax2[]
                   1700: #^a[
                   1701: 
                   1702: @ssave[]
                   1703: $abc[abc]
                   1704: ^abc.save[abc]
                   1705: 
                   1706: @calendar[]
1.103   ! paf      1707: $year(2002)
        !          1708: $month(12)
1.84      paf      1709: ${year}-${month}:<br>
                   1710: $week_days[^date:calendar[rus]($year;$month)]
1.15      paf      1711: <pre>
1.101     paf      1712: ^week_days.menu{^for[wday](0;6){^if($week_days.$wday){$week_days.$wday;&nbsp^;&nbsp^;} }=$week_days.week,$week_days.year=<br>}
1.15      paf      1713: </pre>
                   1714: 
                   1715: @thash[]
                   1716: $table[^table::set{id  name    age
                   1717: 1      paf     278
                   1718: 2      пиф     234
                   1719: }]
                   1720: $hash[^table.hash[id;^table::set[nameless]{id
                   1721: name}]]
                   1722: $hash.2.id $hash.2.name $hash.2.age
                   1723: 
                   1724: @tdef[]
                   1725: $s[0]
                   1726: if 0=^if($s){}{n}<br>
                   1727: if def 0=^if(def $s){y}{}<br>
                   1728: <hr>
                   1729: 
                   1730: @ford[]
                   1731: ^for[i](0;5){$i}{($i)}
                   1732: 
                   1733: @tif[]
                   1734: ^if[def]{y;n}
                   1735: 
                   1736: @image[]
                   1737: $pict[^image::create(400;200)]
                   1738: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-1;$pict.height-1;0;360;0x000000)
                   1739: ^pict.arc($pict.width/2;$pict.height/2;$pict.width-10;$pict.height-10;0+10;360-10;0xff0000)
                   1740: #^pict.arc($pict.width/2;$pict.height/2;$pict.width;$pict.height;0;360;0xff0000)
                   1741: ^pict.circle($pict.width/2;$pict.height/2;$pict.height/2-10;0x0000ff)
                   1742: ^pict.arc($pict.width/2;$pict.height/2;$pict.height-26;$pict.height-26;0+10;360-10;0xff0000)
                   1743: $response:body[^pict.gif[]]
                   1744: 
                   1745: 
                   1746: 
                   1747: @mail2[]
                   1748: ^mail:send[
                   1749:        $.content-type[$.value[text/plain] $.charset[windows-1251]]
                   1750:        $.from[Александр Петросян <paf@design.ru>]
                   1751:        $.to[Александр Петросян <paf@design.ru>]
                   1752:        $.subject[проверка]
                   1753:        $.body[проверка]
                   1754: ]
                   1755: 
                   1756: @cookie[]
                   1757: $env:HTTP_COOKIE<br>
                   1758: 
                   1759: #$cookie:переменная[test тест ТЕСТ2]
                   1760: =$cookie:переменная=<br>
                   1761: #$cookie:переменная2[test тест ТЕСТ3]
                   1762: =$cookie:переменная2=<br>
                   1763: =$cookie:CLASS.переменная2=<br>
                   1764: 
                   1765: @response[]
                   1766: #^if($form:reload){
                   1767:        $response:refresh[$.value[0] $.url[./t.html?uri=$env:SERVER_NAME]]
                   1768: #}
                   1769: 
                   1770: @xslt[]
                   1771: ^xdata[]
                   1772: $transformed[^xdoc.transform[global.xsl;$.param1[123/]]]
                   1773: ^show_xdoc2[$transformed]
                   1774: 
                   1775: @regexp2[]
                   1776: $s[  select]
                   1777: $s[^s.match[^^\s*][]{!}]
                   1778: $s
                   1779: 
                   1780: @header[]
                   1781: $response:refresh[
                   1782:        $.value[0]
                   1783:        $.url[http://design.ru?a=^taint[123]]
                   1784: ]
                   1785: 
                   1786: @ttablerem[]
                   1787: $table[^table::load[a.cfg]]
                   1788: ^table.menu{$table.a}
                   1789: 
                   1790: @tconnect[]
                   1791: ^connect[mysql://test:test@paf/test?charset=cp1251_koi8&compress=1&timeout=1&named_pipe=1]{
                   1792: $tables[^table::sql{show tables}]
                   1793: #$cols[^tables.columns[]]
                   1794: #$cols.column
                   1795: ^tables.menu{
                   1796:        $tables.[Tables_in_test]<br>
                   1797: }
                   1798: }
                   1799: 
                   1800: @pcre[]
                   1801: $s[1 2]
                   1802: ^s.match[\s;ig]{!}
                   1803: #^s.match[\d;ig]{!}
                   1804: 
                   1805: 
                   1806: @regexp[]
                   1807: $s[abcАБВ]
                   1808: ^if(^s.match[б][i]){y}{n}
                   1809: 
                   1810: @mail[]
                   1811: #$ORIGINS(1)
                   1812: ^mail:send[
                   1813:        $.from[paf@design.ru]
                   1814:        $.to[paf@design.ru]
                   1815:        $.body[1
                   1816:        
                   1817:        2
                   1818:        
                   1819:        
                   1820:                3]
                   1821: ]
                   1822: 
                   1823: @exec[]
                   1824: $a[^file::exec[fc.exe;;a;b]]
                   1825: $a.status|$a.stderr<hr>
                   1826: 
                   1827: @fori[][i]
                   1828: ^for[i](1;3){... =$i= ...}
                   1829: 
                   1830: @xdata0[]
                   1831: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                   1832: $xdoc[^xdoc::set{<?xml version="1.0" encoding="windows-1251"?>
                   1833: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                   1834: <people>
                   1835:        <man id="1" имя="word слово">
                   1836:                <name>P&#171^;AF        B</name>
                   1837:        </man>
                   1838:                <man id="2">
                   1839:                        <name>ПИФ^taint[&]</name>
                   1840:                </man>
                   1841: </people>
                   1842: }]
                   1843: 
                   1844: @xdata[]
                   1845: #$response:content-type[$.value[text/html] $.charset[windows-1251]]
                   1846: $xdoc[^xdoc::set{^process{<?xml version="1.0" encoding="windows-1251"?>
                   1847: <!--DOCTYPE people SYSTEM "D:\Y\parser3project\parser3\src\www\htdocs\people.dtd"-->
                   1848: <people>
                   1849:        <man id="1" имя="word слово">
                   1850:                <name>P&#171^;AF        B</name>
                   1851:        </man>
                   1852:                <man id="2">
                   1853:             <name>ПИФ^taint[&]</name>
                   1854:                </man>
                   1855: </people>
                   1856: }}]
                   1857: 
                   1858: @xml[]
                   1859: ^xdata[]
                   1860: 
                   1861: ^show_xdoc2[$xdoc]<hr>
                   1862: #^show_xnode1[$xdoc]<hr>
                   1863: $people[^xdoc.select[*/man]]
                   1864: #^show1[]
                   1865: ^show_xnodes1[$people]<hr>
                   1866: #^people.0.owner.hren[]
                   1867: 
                   1868: ^show_xnode1[^xdoc.selectSingle[*/man[2]/name];0;1]<hr>
                   1869: 
                   1870: by id:
                   1871: ^show_xnode1[^xdoc.getElementById[1];0;1]
                   1872: <hr>
                   1873: 
                   1874: @show1[array]
                   1875: ^for[i](0;^array._count[]-1){
                   1876:     $x[$array.$i]
                   1877:        $x.firstChild.nodeValue: 
                   1878:                $pattributes[$x.parentNode.attributes]
                   1879:                ^if(^pattributes._count[]){
                   1880:                        $pattributes.id.name=$pattributes.id.nodeValue
                   1881:                }
                   1882:        <br>
                   1883: }
                   1884:        
                   1885: @show_xnodes1[array][i]
                   1886: ^for[i](0;^array._count[]-1){
                   1887:        ^show_xnode1[$array.$i;0;1]
                   1888: }
                   1889: 
                   1890: @show_xnode1[x;level;single][l]
                   1891: ^if(def $x){
                   1892:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}
                   1893:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1894:        &lt^;$x.nodeName
                   1895:            $pairs[$x.attributes]
                   1896:            ^if(def $pairs){
                   1897:                $names[^pairs._keys[]]
                   1898:                ^names.menu{ $names.key="$pairs.[$names.key].nodeValue"}
                   1899:            }
                   1900:            &gt^;
                   1901:     }{
                   1902:        [$x.nodeType]
                   1903:     }
                   1904:     
                   1905:     ^if(def $x.nodeValue){$x.nodeValue}<br>
                   1906:     ^show_xnode1[$x.firstChild]($level+1)
                   1907:     ^if(!$single){
                   1908:            ^show_xnode1[$x.nextSibling]($level)
                   1909:     }
                   1910: 
                   1911:     ^if($x.nodeType == $xnode:ELEMENT_NODE){
                   1912:     ^for[l](0;$level-1){&nbsp^;&nbsp^;&nbsp^;&nbsp^;}&lt^;/$x.nodeName&gt^;<br>
                   1913:     }
                   1914: }
                   1915: 
                   1916: @show_xdoc2[xdoc]
                   1917: ^xdoc.save[out/save.xml;
                   1918: #      $.encoding[utf-8]
                   1919:        $.method[xml]
                   1920: ]
                   1921: $file[^xdoc.file[
                   1922:        $.encoding[utf-8]
                   1923:        $.method[html]
                   1924: ]]
                   1925: ^file.save[text;out/save_file.html]
                   1926: #$response:body[^xdoc.file[    $.media-type[text/paf]  ]]
                   1927: <pre>^taint[html][^xdoc.string[
                   1928:        $.method[html]
                   1929: #      $.encoding[utF-8]
                   1930: #      $.omit-xml-declaration[yes]
                   1931: #      $.standalone[no]
                   1932: #      -$.doctype-public[-//W3C//DTD XHTML]
                   1933: #      -$.doctype-system[/a/b/c/]
                   1934: #      $.indent[yes]
                   1935: #      $.media-type[text/paf]
                   1936: ]]
                   1937: </pre>

E-mail: