Diff for /parser3/operators.txt between versions 1.259 and 1.262

version 1.259, 2024/12/20 17:17:47 version 1.262, 2024/12/20 18:59:22
Line 1 Line 1
 операторы  operators
     ^eval(выражение)[формат] выражение, кроме обычных функций:      ^eval(expression)[format] expressions, apart from the usual functions, supports:
         допустимы #комментарии          #comments allowed
             работают до конца строки или закрывающейся круглой скобки              they work until the end of the line or the closing parenthesis
             внутри комментария допустимы вложенные круглые скобки              nested parentheses are allowed inside comments
         из неочевидных операторов:          among the non-obvious operators:
             | побитный xor              | bitwise XOR
             || логический xor              || logical XOR
             ~ побитное отрицание              ~ bitwise negation
             \ целочисленное деление 10\3=3              \ integer division 10\3=3
         def для проверки defined,          def checks if defined:
             пустая строка не defined              an empty string is not defined
             пустая таблица не defined              an empty table is not defined
             пустой hash не defined              an empty hash is not defined
         eq ne lt gt le ge для сравнения строк,          eq ne lt gt le ge for string comparison,
         in "/dir/" для проверки, находится ли текущий документ в каталоге          in "/dir/" to check if the current document is located in the specified directory
             ["внутри не допустимы выражения, если надо сравнить со сложным, пусть это будет переменная]              ["no expressions allowed inside; if you need a complex comparison, assign it to a variable"]
         is 'type' для проверки типа левого операнда,          is 'type' to check the type of the left operand,
             можно проверить, "не hash ли параметр метода?"              e.g., "is the method parameter not a hash?"
         -f для проверки существования файла на диске,          -f checks if a file exists on disk,
         -d для проверки существования каталога на диске,          -d checks if a directory exists on disk,
         строка в кавычках или апострофах - строка, без кавычек или апострофов строка до ближайшего whitespace          a quoted string (double or single quotes) is treated as a string, unquoted text is a string until the nearest whitespace
         числовой литерал бывает 0xABC          numeric literals can be in hex format like 0xABC
         приоритеты:          priorities:
             /* logical */              /* logical */
             %left "!||"              %left "!||"
             %left "||"              %left "||"
             %left "&&"              %left "&&"
             %left '<' '>' "<=" ">="   "lt" "gt" "le" "ge"              %left '<' '>' "<=" ">=" "lt" "gt" "le" "ge"
             %left "==" "!="  "eq" "ne"              %left "==" "!=" "eq" "ne"
             %left "is" "def" "in" "-f" "-d"              %left "is" "def" "in" "-f" "-d"
             %left '!'              %left '!'
   
             /* bitwise */              /* bitwise */
             %left '!|'              %left '!|'
             %left '|'              %left '|'
             %left '&'               %left '&'
             %left '~'              %left '~'
   
             /* numerical */              /* numerical */
Line 42 Line 42
             %left '*' '/' '%' '\\'              %left '*' '/' '%' '\\'
             %left '~'     /* negation: unary */              %left '~'     /* negation: unary */
   
         литералы:          literals:
             true              true
             false              false
   
     ^if(условие){когда да}{когда нет}      ^if(condition){then}{else}
     ^if(условие1){да}[(условие2){да}[(условие2){да}[...]]]{нет}      ^if(condition1){yes}[(condition2){yes}[(condition3){yes}[...]]]{no}
         количество доп. условий не ограничено (в общем elseif это :)          unlimited number of additional conditions (elseif)
   
     ^switch[значение]{^case[вариант1[;вариант2...]]{действие}^case[DEFAULT]{действие по умолчанию}}      ^switch[value]{^case[var1[;var2...]]{action}^case[DEFAULT]{default action}}
   
     ^while(условие){тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^while(condition){body}[[delimiter]|{delimiter executed before each non-empty non-first body}]
   
     ^for[i](0;4){тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^for[i](0;4){body}[[delimiter]|{delimiter executed before each non-empty non-first body}]
   
     ^try{      ^try{
         ...          ...
         ^throw[sql.connect[;вася[;ошибся]]] // был ^error[текст]          ^throw[sql.connect[;vasya[;mistaken]]] // previously ^error[text]
         ^throw[          ^throw[
             $.type[sql.connect]              $.type[sql.connect]
             $.source[вася]              $.source[vasya]
             $.comment[ошибся]              $.comment[mistaken]
         ]          ]
         ...          ...
     }{      }{
         ^if($exception.type eq "sql"){          ^if($exception.type eq "sql"){
             $exception.handled(1|true)  ^rem{флаг, что exception обработан}              $exception.handled(1|true)  ^rem{flag that exception is handled}
             ....              ....
         }          }
         ^switch[$exception.type]{          ^switch[$exception.type]{
             ^case[sql;mail]{              ^case[sql;mail]{
                 $exception.handled(1)                  $exception.handled(1)
                 код, обрабатывающий sql ошибку                  code handling sql error
                 $exception.type = sql.connect                  $exception.type = sql.connect
                 $exception.file $exception.lineno $exception.colno [если не запрещены при компиляции]                  $exception.file $exception.lineno $exception.colno [if not disabled at compile time]
                 $exception.source = вася                  $exception.source = vasya
                 $exception.comment = ошибся                  $exception.comment = mistaken
             }              }
             ^case[DEFAULT]{              ^case[DEFAULT]{
                 код, обрабатывающий другую ошибку                  code handling another error
                 ^throw[$exception] << re-throw // DON'T! It's default behaviour!                  ^throw[$exception] << re-throw // DON'T! It's default behaviour!
             }              }
         }          }
     }      }
   
     ^break[]      ^break[]
         обрывает цикл          breaks the loop
     ^break(true|false)      ^break(true|false)
         обрывает цикл, если true          breaks the loop if true
   
     ^continue[]      ^continue[]
         обрывает итерацию цикла          breaks the current iteration of the loop
     ^continue(true|false)      ^continue(true|false)
         обрывает итерацию цикла, если true          breaks the current iteration if true
   
     ^return[]      ^return[]
         обрывает выполнение метода          stops method execution
     ^return[value]      ^return[value]
         присваивает $result значение value и обрывает выполнение метода          assigns $result the value and stops method execution
   
     ^untaint[[as-is|file-spec|uri|http-header|mail-header|sql|js|json|parser-code|regex|xml|html|optimized-[as-is|xml|html]]]{код}      ^untaint[[as-is|file-spec|uri|http-header|mail-header|sql|js|json|parser-code|regex|xml|html|optimized-[as-is|xml|html]]]{code}
         default as-is          default as-is
   
     ^taint[[lang]][код]      ^taint[[lang]][code]
         default "just tainted, language unknown"          default "just tainted, language unknown"
   
     ^apply-taint[[lang;]текст]      ^apply-taint[[lang;]text]
         выполняет заданные в строке преобразования, неопределенно грязное как lang, на выходе чистая строка          applies transformations specified in the string, "indefinitely dirty" is considered as lang, producing a clean string
   
     ^process[[$caller.CLASS|$object|$КЛАСС:CLASS]]{строка, которая будет process-ed, как код}[      ^process[[$caller.CLASS|$object|$CLASS:CLASS]]{string to be processed as code}[
         $.main[во что переименовать @main]          $.main[what to rename @main to]
         $.file[имя файла из которого, якобы, данный текст]          $.file[name of the file supposedly containing this text]
         $.lineno(номер строки в файле, откуда данный текст, можно отрицательный)          $.lineno(line number in the file from where this text originated, can be negative)
     ]      ]
     ^process..[путь][во что переименовать @main]      ^process..[path][what to rename @main to]
         по умолчанию, методы компилируются в $self [в случае оператора, $self=$MAIN:CLASS]          by default, methods are compiled into $self [in case of operator, $self=$MAIN:CLASS]
   
     ^connect[protocol://строка соединения]]{код с ^sql[...]-ями}      ^connect[protocol://connection-string]]{code with ^sql[...] calls}
         mysql://user:pass@{host[:port][, host[:port]]|[/unix/socket]}/database?          mysql://user:pass@{host[:port][, host[:port]]|[/unix/socket]}/database?
             ClientCharset=parser-charset << charset in which parser thinks client works              ClientCharset=parser-charset << charset in which parser thinks client works
             charset=UTF-8&              charset=UTF-8&
             timeout=3&              timeout=3&
             compress=0&              compress=0&
             named_pipe=1&              named_pipe=1&
             multi_statements=1&  allow execute more then one query in one parser :sql{} request              multi_statements=1&  allow executing more than one query in a single :sql{} request
             config_file=.my.cnf&              config_file=.my.cnf&
             config_group=parser3&  use group name from .my.cnf              config_group=parser3&  use group name from .my.cnf
             autocommit=1              autocommit=1
             autocommit если выставить в 0, будет делать commit/rollback              if autocommit is set to 0, it will perform commit/rollback
   
         pgsql://user:pass@{host[:port]|[local]}/database?          pgsql://user:pass@{host[:port]|[local]}/database?
             client_encoding=win,[to-find-out]              client_encoding=win,[to-find-out]
Line 143 Line 143
             ClientCharset=parser-charset& << charset in which parser thinks client works              ClientCharset=parser-charset& << charset in which parser thinks client works
             autocommit=1              autocommit=1
   
         для работы connect нужно, чтобы заранее (рекомендуется в системном конфигурационном auto.p) была определена таблица          to use ^connect, the $SQL table must be defined beforehand (recommended in the system configuration auto.p)
 #sql drivers  #sql drivers
 $SQL[  $SQL[
     $.drivers[^table::create{protocol   driver  client      $.drivers[^table::create{protocol   driver  client
Line 154  odbc parser3odbc.dll Line 154  odbc parser3odbc.dll
 }]  }]
 ]  ]
     ^rem{}      ^rem{}
         комментарий, удаляется при компиляции          a comment, removed at compile time
   
     ^cache[файл](секунд){код}[{catch код}]      ^cache[file](seconds){code}[{catch code}]
         относительное задание времени          relative time assignment
         скешировать строку, которая получается при выполнении кода на 'секунд' секунд          caches the string resulting from the code execution for 'seconds' seconds
         если 0 секунд, значит не кешировать, а старый такой стереть          if 0 seconds, do not cache, and remove any existing old cache
         в catch коде $exception.handled[cache]  ^rem{флаг, что exception обработан}          in the catch code, $exception.handled[cache]  ^rem{flag that exception is handled}
     ^cache[файл][expires date]{код}[{catch код}]      ^cache[file][expires date]{code}[{catch code}]
         абсолютное задание времени          absolute time assignment
     ^cache[файл]      ^cache[file]
         удалить файл [не ругает, если его нет]          deletes the file [no error if it doesn't exist]
     ^cache(секунд)      ^cache(seconds)
     ^cache[expires date]      ^cache[expires date]
         сигнализирует вышестоящему ^cache "уменьши до стольких-то 'секунд'/'expires'"          signals to the upper-level ^cache "reduce it to these many 'seconds'/'expires'"
         в пределе: ^cache(0) отменить кеширование          ultimately: ^cache(0) cancels caching
     ^cache[]      ^cache[]
         выдаёт текущую expires date          returns the current expires date
   
     у всех методов есть локальная переменная $result, если в неё что положить,      each method has a local variable $result. If you put something in it,
     то это будет результатом метода, а не его тело      that will be the method's result, not its body
   
     у всех методов есть локальная переменная $caller, в ней лежит родительский stack frame,      each method has a local variable $caller, containing the parent stack frame,
     можно записать в его локальную переменную      you can write to its local variables
   
     use(^use или @USE) ищет и подключает файл:      use(^use or @USE) searches for and includes a file:
         1. если путь начинается с /, то считается, что это путь от корня веб пространства          1. If the path starts with /, it is considered a path from the web root
         2. относительно текущей директории          2. Relative to the current directory
         3. относительно строк из table $MAIN:CLASS_PATH, снизу вверх          3. Relative to strings from the $MAIN:CLASS_PATH table, bottom-up
            $MAIN:CLASS_PATH - глобальная строка или таблица с путём или путями к каталогу             $MAIN:CLASS_PATH is a global string or table with a path or paths to a directory
            с классами (от корня веб пространства), задавайте её в конфигурационном auto.p             with classes (from the web root), set it in the configuration auto.p
   
     глобальная табличка $CHARSETS[$.название[имя файла]]      A global table $CHARSETS[$.name[filename]]
     задаёт какие буквы считаются какими (whitespace, letter, etc), а также их unicode         defines which characters are considered what (whitespace, letter, etc.), as well as their Unicode
     формат: tab delimited файл, с заголовком:      format: tab-delimited file, with a header:
         char    white-space    digit    hex-digit    letter    word    lowercase    unicode1    unicode2          char    white-space    digit    hex-digit    letter    word    lowercase    unicode1    unicode2
         A            x    x    x    a    0x0041    0xFF21          A       x              x        x            a        0x0041  0xFF21
         где char и lowercase могут быть буквами, а могут быть и 0xКОДАМИ          where char and lowercase can be letters or 0xCODES
         если символ имеет единственное unicode представление, равное самому символу, можно не указывать unicode          if the character has a single Unicode representation equal to itself, you can omit unicode
     всегда есть кодировка UTF-8, она является кодировкой по-умолчанию для request и response      UTF-8 is always available and is the default encoding for request and response
     ВНИМАНИЕ: имя кодировки case insensitive      WARNING: the encoding name is case-insensitive
   
   syntax
 синтаксис      $name[new value]
     $имя[новое значение]      $name(arithmetic expression of new value)
     $имя(математическое выражение нового значения)      $name{code of new value}
     $имя{код нового значения}      $name whitespace or ${name}something - variable value
     $имя whitespace или ${имя}неважно - вывод значения переменой      ^name parameters - call
     ^имя параметры - вызов      $name.CLASS - class of the value
     $имя.CLASS - класс значения      $name.CLASS_NAME - name of the class
     $имя.CLASS_NAME - имя класса      $name[$.key[] () {}] - constructor of a hash variable with element $name.key
     $имя[$.key[] () {}] - конструктор переменной-хеша с элементом $имя.key      ^method[$.key[] () {}] - constructor of a hash parameter with element $parameter.key
     ^method[$.key[] () {}] - конструктор параметра-хеша с элементом $parameter.key      $CLASS.name  access a class variable
     $CLASS.имя  обращение к переменной класса  
       the name ends before: space tab linefeed ; ] } ) " < > + * / % & | = ! ' , ?
     имя заканчивается перед: пробел tab linefeed ; ] } ) " < >  + * / % & | = ! ' , ?          i.e. you can do $name,aaaa
         т.е. можно $имя,aaaa          but if you need a character after the name, say -, then ${name}-
         но если нужно после имени символ, скажем -, то ${имя}-  
       in expressions, + and - are additional name boundaries
     в выражениях + и - являются дополнительными концами имени  
       you can access compound objects as: $name.subname where subname can be:
     можно обращаться к составным объектам так: $name.subname где subname бывает:          a string
         строка          a $variable
         $переменная          a string$variable
         строка$переменная          [code computing a string]
         [код, вычисляющий строку]      for example: $hash[$.age(88)] $get[$.field[age]] ^hash.[$get.field].format{%05d}
     например: $хеш[$.возраст(88)] $достать[$.поле[возраст]] ^хеш.[$достать.поле].format{%05d}  
   parameters := one or more parameters
 параметры := один или много параметров  parameter :=
 параметр :=      (arithmetic expression) evaluated multiple times inside the call,
     (математическое выражение) вычисляется много раз внутри вызова,  |   [code] evaluated once before the call,
 |   [код] вычисляется один раз перед вызовом,  |   {code} evaluated zero or many times inside the call,
 |   {код} вычисляется 0 или много раз внутри вызова,      ';' are allowed, making multiple parameters in a single bracket
     допустимы ';' чтобы сделать много параметров в одних скобках  
   
 void  void
     доступны все методы, присутствующие у объекта класса string, результат как у пустой строки      all methods present in the string class object are available, the result behaves as if it were an empty string
     ^void:sql{запрос без результата}{$.bind[см. table::sql]}      ^void:sql{query without result}{$.bind[see table::sql]}
   
 int,double  int,double
     ^имя.int[]      ^name.int[]
         целочисленное значение           integer value
     ^имя.double[]      ^name.double[]
         double значение           double value
     ^имя.bool[] ^name.bool(true|false)      ^name.bool[] ^name.bool(true|false)
         bool значение           boolean value
     ^имя.inc(на сколько +)      ^name.inc(how much +)
     ^имя.dec(на сколько -)      ^name.dec(how much -)
     ^имя.mul(на сколько *)      ^name.mul(how much *)
     ^имя.div(на сколько /)      ^name.div(how much /)
     ^имя.mod(на сколько %)      ^name.mod(how much %)
     ^имя.format[формат]      ^name.format[format]
     ^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[см. table::sql]]]      ^int/double:sql{query}[[$.limit(2) $.offset(4) $.default{0} $.bind[see table::sql]]]
         запрос, результат которого должен быть один столбец/одна строка          the query result should be one column/one row
   
 string  string
     в выражении      in expression
         def значение равно "не пуста?"          def value means "not empty?"
         логическое/числовое значение равно попытке преобразовывания к double,          logical/numerical value equals an attempt to convert to double,
             пустая строка тихо преобразуется к 0              an empty string quietly converts to 0
         пример:          example:
         ^if(def $form:name) не пуста?          ^if(def $form:name) not empty?
         ^if($user.isAlive) истина? [автопреобразование к числу, не ноль?]          ^if($user.isAlive) true? [auto-convert to number, not zero?]
     ^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[см. table::sql]]]      ^string:sql{query}[[$.limit(1) $.offset(4) $.default{n/a} $.bind[see table::sql]]]
         результат запроса должен быть один столбец/одна строка          the query result should be one column/one row
     ^строка.int[] ^строка.int(default)      ^string.int[] ^string.int(default)
         целочисленное значение строки, если ломается преобразование, берётся default          integer value of the string, if conversion fails, default is taken
     ^строка.double[] ^строка.double(default)      ^string.double[] ^string.double(default)
         double значение строки, если ломается преобразование, берётся default          double value of the string, if conversion fails, default is taken
     ^строка.bool[] ^строка.bool(default)      ^string.bool[] ^string.bool(default)
         bool значение строки, если ломается преобразование, берётся default          boolean value of the string, if conversion fails, default is taken
     ^строка.format[формат] %d  %.2f %02d...      ^string.format[format] %d  %.2f %02d...
     ^строка.match[шаблон-строка|шаблон-regex][[опции поиска]]  $prematch $match $postmatch $1 $2...      ^string.match[string-pattern|regex-pattern][[search options]] $prematch $match $postmatch $1 $2...
         опции поиска=          search options:
         i CASELESS          i CASELESS
         x whitespace in regex ignored          x whitespace in regex ignored
         s singleline = $ считается концом всего текста          s singleline = $ matches end of entire text
         m multiline = $ считается концом строки[\n], не концом всего текста          m multiline = $ matches end of line[\n], not end of entire text
         g найти все вхождения, а не одно          g find all occurrences, not just one
         ' создавать столбцы prematch, match, postmatch          ' create columns prematch, match, postmatch
         n вернуть цисло с количеством найденных совпадений, а не таблицу с результатами          n return the number of matches instead of a table
         U инвертировать смысл модификатора '?'          U invert the meaning of the '?' modifier
     ^строка.match[шаблон-строка|шаблон-regex][опции поиска]{замена}      ^string.match[string-pattern|regex-pattern][search options]{replacement}
         опции поиска+=          additional search option:
         g заменить все вхождения, а не одно          g replace all occurrences, not just one
     ^строка.split[разделитель|regex][[lrhva]][[название столбца для вертикального разбиения]]      ^string.split[delimiter|regex][[lrhva]][[column name for vertical splitting]]
         l слева направо [default]          l left to right [default]
         r справа налево          r right to left
         h nameless таблица с ключами 0, 1, 2, ...          h nameless table with keys 0, 1, 2, ...
         v таблица из 1 столбца 'piece' или как передадут [default]          v table of one column 'piece' or as provided [default]
         a массив          a array
     ^строка.{l|r}split[разделитель] таблица из столбца $piece      ^string.{l|r}split[delimiter] a table from the $piece column
         оставлен для совместимости          kept for compatibility
     ^строка.upper|lower[]      ^string.upper|lower[]
     ^строка.length[]      ^string.length[]
     ^строка.mid(P[;N])      ^string.mid(P[;N])
         без N - "до конца строки"          without N - "until the end of the string"
     ^строка.left(N), -1 выдает всю строку      ^string.left(N), -1 returns the entire string
     ^строка.right(N)      ^string.right(N)
     ^строка.pos[подстрока]      ^string.pos[substring]
     ^строка.pos[подстрока](позиция, с которой ищем)      ^string.pos[substring](position from which to search)
         <0 = не найдено          <0 = not found
     ^строка.replace[$таблица_подстановок_строка_на_строку]      ^string.replace[$table_of_substitutions_string_to_string]
     ^строка.replace[$что;$на-что]      ^string.replace[$what;$to]
     ^строка.save[[append;]путь]      ^string.save[[append;]path]
     ^строка.save[путь[;$.charset[в какой кодировке сохраняем] $.append(true)]]      ^string.save[path[;$.charset[in which encoding save] $.append(true)]]
         сохраняет строку в файл          saves the string to a file
     ^строка.trim[start|both|end|left|right[;chars]]      ^string.trim[start|both|end|left|right[;chars]]
         выкидывает chars из начала/конца/и начала и конца          removes chars from the start/end/or both start and end
         default 'chars' = whitespace chars          default 'chars' = whitespace chars
     ^строка.trim[chars]      ^string.trim[chars]
         выкидывает chars из начала и конца          removes chars from start and end
     ^строка.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode      ^string.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ] encode
     ^string:base64[encoded[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode      ^string:base64[encoded[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]] decode
     ^строка.idna[]      ^string.idna[]
         IDNA кодирование, поддержка кириллических доменов          IDNA encoding, supports Cyrillic domains
     ^string:idna[encoded]      ^string:idna[encoded]
         IDNA декодирование, поддержка кириллических доменов          IDNA decoding, supports Cyrillic domains
     ^строка.js-escape[]      ^string.js-escape[]
         кодирование для передачи в JS (%uXXXX)          encoding for passing to JS (%uXXXX)
     ^string:js-unescape[escaped]      ^string:js-unescape[escaped]
         декодирование переданного из js          decoding from js
     ^string:unescape[js|uri;escaped; $.charset[] ]      ^string:unescape[js|uri;escaped; $.charset[] ]
         декодирование переданного из js или uri          decoding passed from js or uri
     ^строка.contains[ключ]      ^string.contains[key]
         для совместимости с hash          for compatibility with hashtable
   
 table  table
     в выражении      in expression
         логическое значение равно "не пуста?"          logical value means "not empty?"
         числовое значение равно count[]          numerical value equals count[]
     $таблица.поле      $table.field
     $таблица.поле[новое значение]      $table.field[new value]
     $таблица.fields      $table.fields
         из named таблицы выдаёт текущую запись как Hash          from a named table returns the current record as a Hash
     ^table::create[[nameless]]{данные}[[$.separator[^#09] $.encloser[]]]      ^table::create[[nameless]]{data}[[$.separator[^#09] $.encloser[]]]
     ^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]      ^table::create[table][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]
         клонирует таблицу          clones the table
         reverse - в обратном порядке          reverse - in reverse order
     ^table::load[[nameless;]путь[;опции]]      ^table::load[[nameless;]path[;options]]
         если не nameless, названия колонок берутся из первой строки          if not nameless, column names are taken from the first line
         пустые строки, и строки в первой колонке содержащие '#', игнорируются          empty lines, and lines in the first column containing '#' are ignored
         $.separator[^#09]          $.separator[^#09]
         $.encloser["] по-умолчанию, нет          $.encloser["] by default, none
     ^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash]]]      ^table::sql{query}[[$.limit(2) $.offset(4) $.bind[hash]]]
         bind привязывает переменные в запросе к их значениям          bind associates variables in the query with their values
         пока реализован только для oracle          currently implemented only for oracle
         в запросе надо написать ":имя"          in the query you need to write ":name"
         в параметре bind передать hash, из которого возьмётся (или куда запишется) значение          in the bind parameter pass a hash from which the value is taken (or where it is written)
     ^таблица.save[[nameless|append;]путь[;опции, см. load]]      ^table.save[[nameless|append;]path[;options, see load]]
         сохраняет таблицу в файл          saves the table to a file
     ^таблица.menu{тело}[[разделитель]]      ^table.menu{body}[[delimiter]]
         выполняет код тела для каждой строки таблицы          executes the body code for each row of the table
     ^таблица.foreach[позиция;значение]{тело}[[разделитель]]      ^table.foreach[position;value]{body}[[delimiter]]
     ^таблица.line[]      ^table.line[]
         текущий ряд таблицы, начинается с 1          current table row, starting from 1
     ^таблица.offset[]      ^table.offset[]
         смещение текущего ряда таблицы от начала, начинается с 0          offset of the current row from the start, starting from 0
     ^таблица.offset[[whence]](5)       ^table.offset[[whence]](5)
         сдвигает whence=cur|set, без whence - это cur          shifts whence=cur|set, without whence = cur
     ^таблица.count[], ^таблица.count[rows]      ^table.count[], ^table.count[rows]
         количество строк в таблице          number of rows in the table
     ^таблица.count[columns]      ^table.count[columns]
         количество столбцов таблицы          number of columns
     ^таблица.count[cells]      ^table.count[cells]
         количество ячеек в текущей строке таблицы          number of cells in the current row
     ^таблица.sort{{ключеделатель строка}|(ключеделатель число)}[{desc|asc}] default=asc      ^table.sort{{string-key-maker}|(numeric-key-maker)}[{desc|asc}] default=asc
     ^таблица.append{данные}      ^table.append{data}
     ^таблица.append[ $.имя столбца[значение столбца] ]      ^table.append[ $.column_name[column_value] ]
     ^таблица.insert{данные} добавить запись на текущую позицию      ^table.insert{data} add a record at the current position
     ^таблица.insert[ $.имя столбца[значение столбца] ]      ^table.insert[ $.column_name[column_value] ]
     ^таблица.delete[]      ^table.delete[]
         стирает запись с текущей позиции          deletes the record at the current position
     ^таблица.join[таблица][$.limit(1) $.offset(5) $.offset[cur]]      ^table.join[table][$.limit(1) $.offset(5) $.offset[cur]]
         добавляет записи из таблицы, таблицы должны иметь одинаковую структуру          adds records from the table, tables must have the same structure
     ^таблица.flip[]      ^table.flip[]
         выдаёт транспонированную          returns the transposed version
     ^таблица.locate[поле;значение][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]      ^table.locate[field;value][[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]
         передвигает текущую строку, если найдёт. выдаёт bool          moves the current row if found. returns bool
     ^таблица.locate(логическое выражение)[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]      ^table.locate(logical expression)[[$.limit(1) $.offset(5) $.offset[cur] $.reverse(1)]]
         передвигает текущую строку, если найдёт. выдаёт bool          moves the current row if found. returns bool
     ^таблица.hash{[поле]|{код}|(выражение)}[[поле значений|table поля значений]{код значения}][[$.distinct(1) $.distinct[tables] $.type[hash]]]      ^table.hash{[field]|{code}|(expression)}[[value field(s)|table of value fields]{value code}][[$.distinct(1) $.distinct[tables] $.type[hash]]]
         по умолчанию значением $hash.ключ будет hash в котором поля значений будут ключами          by default $hash.key value is a hash where value fields are keys
         поля значений могут быть не указаны, тогда ими будут все столбцы, включая ключевой          value fields may not be specified, then they are all columns including the key
         если distinct содержит true, то не будет ошибки при повторяющихся ключах          if distinct is true, no error if duplicate keys
         если distinct содержит tables, то будет создан hash из таблиц, содержащих строки с ключом          if distinct is tables, a hash of tables is created, containing rows with that key
         $.type[string/table] поменять значение элемента на строку (указать одну колонку) или таблицу          $.type[string/table] changes the element value to a string (specify one column) or a table
     ^таблица.columns[[название столбца]]      ^table.columns[[column name]]
         таблица из одного столбца 'column' или как передадут          table of one column 'column' or as provided
     ^таблица.cells[], ^таблица.cells(лимит)      ^table.cells[], ^table.cells(limit)
         выдает массив ячеек текущей строки          returns an array of cells of the current row
     ^таблица.array[]      ^table.array[]
         возвращает массив, элементами которого являются хеши, отображающие данные каждой строки          returns an array of hashes, each hash representing the data of one row
     ^таблица.array[колонка]      ^table.array[column]
         возвращает массив значений указанной колонки          returns an array of values from the specified column
     ^таблица.array{код}      ^table.array{code}
         возвращает массив результатов выполнения переданного кода для каждой строки таблицы          returns an array of results from executing the given code for each row
     ^таблица.rename[название столбца;новое навание столбца] ^таблица.rename[ $.название столбца[новое навание столбца] ]      ^table.rename[column name;new column name] ^table.rename[ $.column_name[new column name] ...]
         переименовывает столбец или столбцы          renames a column or multiple columns
     $отобранное[^таблица.select(выражение)]      $selected[^table.select(expression)]
         таблица из тех столбцов и строк, у которых условие совпало          a table from those columns and rows where the condition matched
         $adults[^man.select($man.age>=18)]          $adults[^man.select($man.age>=18)]
     ^таблица.color[цвет1;цвет2]      ^table.color[color1;color2]
         чередует цвет1 и цвет2 последовательно для каждого ряда          alternates color1 and color2 for each row
   
 hash  hash
     в выражении      in expression
         логическое значение равно "не пуст?", хеш с _default уже не пуст          logical value means "not empty?", a hash with _default is already not empty
         числовое значение равно count[]          numerical value equals count[]
     $хеш.ключ      $hash.key
         _default - специальный ключ, если задан,          _default - a special key, if defined,
         то при обращении по ключу, которому нет соответствия, выдаётся _default значение          then when accessing a non-existing key, _default value is returned
     $хеш.fields      $hash.fields
         выдает $hash, чтобы класс hash был чуть больше похож на класс table          returns $hash, making hash class more similar to table class
     ^hash::create[[|copy_from_hash|copy_from_hashfile]]      ^hash::create[[|copy_from_hash|copy_from_hashfile]]
         создаёт новый hash, копию старого          creates a new hash, a copy of the old one
     ^хеш.add[слагаемое]      ^hash.add[term]
         перезаписывает одноимённые          overwrites entries with the same name
     ^хеш.sub[вычитаемое]      ^hash.sub[subtracted]
     ^хеш.union[b]      ^hash.union[b]
         объединение, одноимённые остаются          union, same-named remain
     ^хеш.intersection[b][[$.order[self|arg]]]      ^hash.intersection[b][[$.order[self|arg]]]
         пересечение, новый хеш, order задает порядок элементов (как в исходном хеше или хеше-параметре)          intersection, new hash, order defines the element order (as in the source hash or parameter hash)
     ^хеш.intersects[b] = bool      ^hash.intersects[b] = bool
     ^hash::sql{запрос}[[$.distinct(1) $.limit(2) $.offset(4) $.type[hash|string|table]]]      ^hash::sql{query}[[$.distinct(1) $.limit(2) $.offset(4) $.type[hash|string|table]]]
         получается hash(ключи=значения первая колонка ответа) of hash(ключи=названия остальных колонкок ответа) или          results is hash(keys = values of the first column of the response) of hash(keys = names of the other columns), or
         string=значение каждого элемента - строка, при этом надо указать ровно два столбца или          string = each element's value is a string (need exactly two columns), or
         table=значение каждого элемента - таблица          table = each element's value is a table
     ^хеш.keys[[название колонки с ключами]]      ^hash.keys[[name of key column]]
         таблица из одного столбца key или как передадут          a table of one 'key' column or as provided
     ^хеш.count[]      ^hash.count[]
     ^хеш.foreach[key;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^hash.foreach[key;value]{body}[[delimiter]|{delimiter executed before each non-empty non-first body}]
     ^хеш.delete[ключ]      ^hash.delete[key]
         удалить ключ          delete key
     ^хеш.contain[ключ]      ^hash.contain[key]
         существует ли в хеше ключ (bool)          checks if hash contains a key (bool)
     ^хеш.at[first|last][[key|value|hash]]      ^hash.at[first|last][[key|value|hash]]
     ^хеш.at([-]N)[[key|value|hash]]      ^hash.at([-]N)[[key|value|hash]]
         доступ к заданным элементам упорядоченного хеша          access specified elements of an ordered hash
     ^хеш.set[first|last;значение]      ^hash.set[first|last;value]
     ^хеш.set([-+]N)[значение]      ^hash.set([-+]N)[value]
         устанавливает значение заданного элемента упорядоченного хеша          sets the value of the specified ordered hash element
     ^хеш.rename[старый_ключ;новый_ключ]      ^hash.rename[old_key;new_key]
     ^хеш.rename[ $.старый_ключ[новый_ключ] ... ]      ^hash.rename[ $.old_key[new_key] ...]
         переименовывает заданные ключи хеша          renames the specified hash keys
     ^хеш.sort[key;value]{{ключеделатель строка}|(ключеделатель число)}[[desc|asc]] default=asc      ^hash.sort[key;value]{{string-key-maker}|(numeric-key-maker)}[[desc|asc]] default=asc
     $обратный_хеш[^хеш.reverse[]]      $reversed_hash[^hash.reverse[]]
     $отобранное[^хеш.select[key;value](выражение)[ $.limit(N) $.reverse(bool) $.default(bool) ]]      $selected[^hash.select[key;value](expression)[ $.limit(N) $.reverse(bool) $.default(bool) ]]
         хеш из ключей и значений, для которых условие истинно          a hash of keys and values for which the condition is true
   
 hashfile  hashfile
     ^hashfile::open[filename]      ^hashfile::open[filename]
     ^хешфайл.clear[]      ^hashfile.clear[]
         забыть всё          forget all
     $хешфайл.ключ[значение]      $hashfile.key[value]
         положить значение          put value
     $хешфайл.ключ[$.value[значение] $.expires[ЗНАЧЕНИЕ]}      $hashfile.key[$.value[value] $.expires[VALUE]]
         положить значение до expires          put value until expires
         значение поля expires может быть date, или число дней(0дней=на вечно)          expires can be a date, or number of days (0days=forever)
     $хешфайл.ключ  достать      $hashfile.key retrieve
     ^хешфайл.delete[ключ]  удалить ключ      ^hashfile.delete[key] delete key
     ^хешфайл.delete[]  удалить файлы, содержащие данные      ^hashfile.delete[] delete files containing data
     ^хешфайл.hash[]      ^hashfile.hash[]
         преобразовать в обычный hash          convert to a regular hash
         попутно стирает устаревшие пары          removing expired pairs along the way
     ^хешфайл.foreach[key;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^hashfile.foreach[key;value]{body}[[delimiter]|{delimiter executed before each non-empty non-first body}]
     ^хешфайл.release[]      ^hashfile.release[]
         записать данные и снять блокировки          write data and release locks.
         при повторном обращении к элементам откроется автоматически          next access to elements will reopen automatically.
     ^хешфайл.cleanup[]      ^hashfile.cleanup[]
         пробежаться по всем элементам и удалить устаревшие.          iterate all elements and delete expired ones.
   
     пример:      example:
     $sessions[^hashfile::open[/db/sessions]]      $sessions[^hashfile::open[/db/sessions]]
     $sid[^math:uuid[]]      $sid[^math:uuid[]]
     $sessions.$sid[$.value[$uid] $.expires(1)]      $sessions.$sid[$.value[$uid] $.expires(1)]
     $uid[$sessions.$sid]      $uid[$sessions.$sid]
   
   
 array  array
     в выражении      in expression
         логическое значение равно "не пуст?"          logical value means "not empty?"
         числовое значение равно count[]          numerical value equals count[]
     $массив.индекс, $массив.(выражение)      $array.index, $array.(expression)
         возврат значения по заданному индексу          returns the value at the given index
     $массив.индекс[значение], $массив.(выражение)[значение]      $array.index[value], $array.(expression)[value]
         присваивание значения по индексу          assigns a value by index
     $массив[значение;значение;...]      $array[value;value;...]
         создание массива с заданными значениями          creates an array with the given values
     ^array::create[]      ^array::create[]
     ^array::create[значение;значение;...]      ^array::create[value;value;...]
         создание массива с заданными значениями или пустого массива          creates an array with the given values or an empty array
     ^array::copy[копируемый массив или хеш с цифровыми ключами]      ^array::copy[array or hash with numeric keys]
         копирование массива или хеша с цифровыми ключами          copies an array or a hash with numeric keys
     ^массив.add[добавляемый массив или хеш с цифровыми ключами]      ^array.add[array or hash with numeric keys]
         добавление элементов из другого массива или хеша с перезаписью значений у совпадающих индексов          adds elements from another array or hash, overwriting values for matching indexes
     ^массив.join[добавляемый массив или произвольный хеш]      ^array.join[array or any hash]
         добавление элементов другого массива или хеша в конец массива          appends elements from another array or hash to the end of the array
     ^массив.append[значение;значение;...]      ^array.append[value;value;...]
         добавление элементов в конец массива          appends elements to the end of the array
     ^массив.insert(индекс)[значение;значение;...]      ^array.insert(index)[value;value;...]
         вставка элементов в указанную позицию массива          inserts elements at the specified position in the array
     ^массив.left(n)      ^array.left(n)
         возвращает новый массив из n первых элементов массива          returns a new array of the first n elements
     ^массив.right(n)      ^array.right(n)
         возвращает новый массив из n последних элементов массива          returns a new array of the last n elements
     ^массив.mid(m;n)      ^array.mid(m;n)
         возвращает новый массив, содержащий n инициализированных элементов массива, начиная с позиции m          returns a new array containing n initialized elements starting from position m
     ^массив.delete(index)      ^array.delete(index)
         удаление элемента массива с оставлением пустого места          deletes an array element, leaving an empty spot
     ^массив.remove(index)      ^array.remove(index)
         удаление элемента со сдвигом последующих элементов на его место          deletes an element and shifts subsequent elements to fill the gap
     ^массив.push[значение]      ^array.push[value]
         добавление элемента в конец массив          adds an element to the end of the array
     ^массив.pop[]      ^array.pop[]
         возвращает последний элемент и удаляет его из массива          returns the last element and removes it from the array
     ^массив.contain(индекс)      ^array.contain(index)
         существует ли в массиве элемент по переданому индексу (bool)          checks if an element exists at the given index (bool)
     ^array::sql{запрос}[[ $.sparse(false) $.distinct(false) $.limit(2) $.offset(4) $.type[hash|string|table]]]      ^array::sql{query}[ $.sparse(false|true) $.distinct(false|true) $.limit(n) $.offset(n) $.type[hash|string|table] ]
         создание массива на основе выборки из базы данных          creates an array based on a database query
         $.sparse(false), по умолчанию - создать обычный массив. Значения строк выборки последовательно добавляются в массив          $.sparse(false), default - create a normal array. Row values from the query are added sequentially
         $.sparse(true) - создать разреженный массив. Первая колонка данных должна содержать индексы,          $.sparse(true) - create a sparse array. The first column must contain indexes
         по которым будут размещены значения (аналогично ^hash::sql{})          at which values will be placed (similar to ^hash::sql{})
         получается array of hash (ключи=названия остальных колонкок ответа) или          result is an array of hash (keys=column names of the rest of the answer) or
         string = значение каждого элемента - строка, при этом надо указать ровно два столбца или          string = each element's value is a string (need exactly two columns), or
         table = значение каждого элемента - таблица          table = each element's value is a table
     ^массив.keys[[название колонки с ключами]]      ^array.keys[[column name for keys]]
         таблица из одного столбца key или переданного названия с индексами инициализированных элементов массива          a table of one 'key' column (or as provided) with the indexes of initialized elements
     ^массив.count[]      ^array.count[]
         количество инициализированных элементов массива          the number of initialized elements in the array
     ^массив.count[all]      ^array.count[all]
         общее количество элементов массива, включая неинициализированные          the total number of elements, including uninitialized ones
     ^массив.foreach[index;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^array.foreach[index;value]{code}[[delimiter]|{delimiter executed before each non-empty non-first body}]
         перебирает все инициализированные элементы массива          iterates over all initialized elements
     ^массив.for[index;value]{тело}[[разделитель]|{разделитель который выполняется перед непустым очередным не первым телом}]      ^array.for[index;value]{code}[[delimiter]|{delimiter executed before each non-empty non-first body}]
         перебирает все элементы массива          iterates over all elements
     ^массив.at[first|last][[key|value|hash]]      ^array.at[first|last][[key|value|hash]]
     ^массив.at([-]число)[[key|value|hash]]      ^array.at([-]number)[[key|value|hash]]
         доступ к элементу массива по порядковому номеру          accesses an array element by its ordinal number
     ^массив.set[first|last][значение]      ^array.set[first|last][value]
     ^массив.set([-]число)[значение]      ^array.set([-]number)[value]
         установка значения элемента массива по порядковому номеру          sets the value of an array element by ordinal number
     ^массив.compact[]      ^array.compact[]
         удаление неинициализированных элементов массива          removes uninitialized elements
     ^массив.compact[undef]      ^array.compact[undef]
         удаление неинициализированных и пустых элементов массива          removes uninitialized and empty elements
     ^массив.sort[key;value]{{ключеделатель строка}|(ключеделатель число)}[[desc|asc]] default=asc      ^array.sort[key;value]{{string-key-maker}|(numeric-key-maker)}[[desc|asc]] default=asc
         сортировка массива          sorts the array
     $обратный_массив[^массив.reverse[]]      $reversed_array[^array.reverse[]]
         возвращает новый массив из элементов исходного в обратном порядке          returns a new array with elements in reverse order
     $отобранное[^массив.select[key;value](выражение)[ $.limit(N) $.reverse(bool) ]]      $selected[^array.select[key;value](expression)[ $.limit(N) $.reverse(bool) ]]
         отбор элементов массива, для которых условие истинно          selects array elements for which the condition is true
   
   date
       date type can be used in expressions, substituting the number of days since epoch [1 January 1970 (UTC)], fractional
       the string value is in local time, numerically in UTC, range from 0000-00-00 00:00:00 to 9999-12-31 23:59:59
       by default the OS-defined timezone is used
   
       ^date::now[]
       ^date::now(days offset)
           returns now+offset
       ^date::today[]
           date at 00:00:00 of the current day
       ^date::today(integer days offset)
           date at 00:00:00 of current day+offset
       ^date::create(days since epoch)
       ^date::create(year;month[;day[;hour[;minute[;second[;TZ]]]]])
       ^date::create[date in format %Y-%m-%d %H:%M:%S]
           convenient creation from a value from a database
           format1: %Y[-%m[-%d[ %H[:%M[:%S]]]]]
           format2: %H:%M[:%S]
       ^date::create[date in format %Y-%m-%dT%H:%M[:%S]TZ]
           for creation from ISO 8601 format
           TZ format: Z(UTC) or +-hour[:minute] (offset from UTC)
       ^date::unix-timestamp()
       ^date.unix-timestamp[]
       $date.year month day hour minute second weekday yearday(0...) daylightsaving TZ weekyear
           TZ="" << local zone
       $date.year month day hour minute second can be set to new values, others are read-only
       ^date.double[] ^date.int[]
           the number of days since epoch [1 January 1970 (UTC)], fractional or truncated
       ^date.roll[year|month|day](+-offset)
           shifts the date
       ^date.roll[TZ;New zone]
           says that the date is in such a timezone: affects .hour & Co
       ^date:roll[TZ;New zone]
           says that by default all dates are in that timezone
       ^date.sql-string[[datetime|date|time]]
           datetime or without parameter - %Y-%m-%d %H:%M:%S
           date                          - %Y-%m-%d
           time                          - %H:%M:%S
           where published='^date.sql-string[]'
       ^date:calendar[rus|eng](year;month)
           returns an unnamed table, columns: 0..6, week, year
       ^date:calendar[rus|eng](year;month;day)
           returns a named table, columns: year, month, day, weekday
       ^date:last-day(year;month)
           returns the last day of the month
       ^date.last-day[]
           returns the last day of $date's month
       ^date.gmt-string[]
           Fri, 23 Mar 2001 09:32:23 GMT
       ^date.iso-string[]
           2001-03-23T12:32:23+03
   
   file
       $uploaded_file_from_post.name
       $uploaded_file_from_post.size
       $uploaded_file_from_post.text
       ^file.save[text|binary;filename[;$.charset[which charset to save in]]]
       ^file:delete[filename]
       ^file:find[filename][{if not found}]
       ^file:list[path[;pattern-string|pattern-regex]]
           table with columns name dir
       ^file:list[path;$.filter[pattern-string|pattern-regex] $.stat(true)]
           table with columns name dir size [mca]date
       ^file::load[text|binary;big.zip[;domain_press_release_2001_03_01.zip][;options]]
       ^file::create[text|binary;filename;data]
       ^file::create[text|binary;filename;data[;$.charset[charset of the created file] $.content-type[...]]]
       ^file::create[string-or-file-content[;$.name[name] $.mode[text|binary] $.content-type[...] $.charset[...]]]
       $loaded_file.size
       $loaded_or_created_file.mode = text/binary
       ^file::stat[filename]
       $stated_or_loaded_file.size .adate .mdate .cdate
       ^file::cgi[[text|binary;]filename[;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]]
           any argument can be string or array of strings
           the returned header is split into $fields
           $status
           $stderr
       ^file::exec[[text|binary;]filename[;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]]
           any argument can be string or array of strings
           options:
               $.stdin[text|file] if empty, disables automatic passing of HTTP-POST data
       ^file:move[oldfilename;newfilename]
           can rename and move directories [win32: but not across disk boundaries]
           directories for dest are created with 775 permissions
           source directory is removed if empty after move
       ^file:copy[filename;copy_filename[; $.append(1) ]]
           can only copy files
       ^file:lock[filename]{code}
           the file is created if necessary
           locked
           code executed
           unlocked
       ^file:dirname[/a/some.tar.gz|file]=/a (works like *nix command)
       ^file:dirname[/a/b/|file]=/a (works like *nix command)
       ^file:basename[/a/some.tar.gz|file]=some.tar.gz (like *nix)
       ^file:basename[/a/b/|file]=b (like *nix)
       ^file:justname[/a/some.tar.gz|file]=some.tar
       ^file:justext[/a/some.tar.gz|file]=gz
       /some/page.html: ^file:fullpath[a.gif] => /some/a.gif
       ^file.sql-string[]
           inside ^connect gives a correctly escaped string that can be used in queries
       ^file::sql{query}[[ $.name[filename_for_download] $.content-type[user content-type] ]]
           the query result should be "one row".
           columns:
           first column - data
           if second exists - filename
           if third - content-type
       ^file.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ]
           encode
       ^file:base64[filename[; $.pad(bool) $.wrap(bool) $.url-safe(bool) ]]
           encode
       ^file::base64[encoded string[; $.pad(bool) $.strict(bool) $.url-safe(bool) ]]
           decode
       ^file::base64[mode;filename;encoded string[; $.content-type[...] $.pad(bool) $.strict(bool) $.url-safe(bool) ]]
           decode
       ^file:crc32[filename]
           calculates crc32 of the specified file
       ^file.crc32[]
           calculates crc32 of the object
       ^file.md5[], ^file:md5[filename]
           returns the file's digest, 16 bytes as a string,
           bytes in hex, contiguous, lowercase
   
   image
       $image[^image::measure[DATA[; $.exif(bool) $.xmp(bool) $.xmp-charset[] $.video(bool) ]]]
           checks the file extension case-insensitively
           can measure gif, jpg, tiff, bmp, webp and mp4 (mov)
       $image.exif << hash after measure jpeg with exif information and $.exif(true)
           $image.exif.DateTime & co
               [full list see https://exiftool.org/TagNames/EXIF.html]
           numbers as int/double,
           dates as date,
           enumerations as hash with keys 0..count-1
       $image.src .width .height
       $image.line-width  number=line width
       $image.line-style  string=line style '*** * '='*** * *** * *** * '
       ^image.html[[hash]]
           <img ...>
       ^image::load[background.gif]
           only gif so far
       ^image::create(width X;height Y[;background color default white]])
       ^image.line(x0;y0;x1;y1;0xffFFff)
       ^image.fill(x;y;0xffFFff)
       ^image.rectangle(x0;y0;x1;y1;0xffFFff)
       ^image.bar(x0;y0;x1;y1;0xffFFff)
       ^image.replace(hex-color1;hex-color2)[table x:y polygon_vertices]
       ^image.polyline(color)[table x:y points]
       ^image.polygon(color)[table x:y polygon_vertices]
       ^image.polybar(color)[table x;y polygon_vertices]
       ^image.font[set_of_letters;font_file.gif][(space_width[;char_width])]
           the character height = image height/number of letters in the set
           if char_width is specified, then monospaced, if 0, char_width = gif width
       ^image.font[set_of_letters;font_file.gif;
           $.space(space_width)      // default = gif width
           $.width(char_width)       // see above, default proportional
           $.spacing(letter_spacing) // default = 1
       ]
       ^image.text(x;y)[text] AS_IS
       ^image.length[text] AS_IS
       ^image.gif[optional filename]
           encodes to FILE with content-type=image/gif the filename will be used by $response:download
       ^image.arc(center x;center y;width;height;start in degrees;end in degrees;color)
       ^image.sector(center x;center y;width;height;start in degrees;end in degrees;color)
       ^image.circle(center x;center y;r;color)
       ^image.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]])
           if dest_w/dest_h are specified, resizes the piece
               when reducing size, does resample
               only suitable for simplifying low-color graphics like charts/pie,
               not suitable for thumbnails
           if dest_h is not specified, aspect ratio is kept
           tolerance - a number [square distance in RGB space to the target color],
               defining how greedy the color approximation from the palette is [default=150]
               smaller - more accurate but colors run out quickly
               larger - less accurate approximation, but covers a bigger part
       ^image.pixel(x;y)[(color)]
           get or set pixel color
   
   regex
       in expression
           logical value is always true
           numerical value is equal to the number of bytes of the compiled pattern
       ^regex::create[pattern-string|regex][[search options]]
       ^pattern.size[]
           number of bytes of the compiled pattern
           if the value is very large - it is worth consulting pcre documentation and possibly rewriting the pattern
       ^pattern.study_size[]
           size of the study-structure. if == 0 - the pattern cannot be "studied"
       $pattern.pattern
           the text of the pattern
       $pattern.options
           the string with the original text of the options
   
   console
       $console:timeout
       $console:line
           read/write string
   
   cookie
       $cookie:name read old or newly set cookie
       $cookie:name[value] for 90 days
       $cookie:name[$.value[value] $.expires[VALUE] $.secure(true) $.domain[domain name] $.httponly(true)]
           the expires field value can be 'session', a date, or a number of days (0days=forever)
           if it's a date, it will be converted to "Sun, 25-Aug-2002 12:03:45 GMT"
       $cookie:fields
           hash with all cookies
   
   env
       $env:variable
       $env:fields hash with environment variables
       $env:PARSER_VERSION parser version
   
 form  form
     [берётся первый элемент из одноимённых из GET, потом первый из POST]      [the first element with the same name is taken from GET, then from POST]
     $form:поле      $form:field
         string/file          string/file
     $form:nameless      $form:nameless
         поле со значением поля без имени "?value&...", "...&value&...", "...&value"          field with a value from a nameless parameter "?value&...", "...&value&...", "...&value"
     $form:qtail      $form:qtail
         строка со значением текста после второго "?xxxxx", если там не было ',' [imap]          string with the value after the second "?xxxxx" if there was no ',' [imap]
     $form:fields      $form:fields
         hash со всеми полями формы          hash with all form fields
     $form:elements.поле      $form:elements.field
         array со всеми значениями поля - как строковыми, так и файловыми          array with all values of the field - both string and file
     $form:tables.поле      $form:tables.field
         table с одним столбцом "field" со значениями "поля", для множественных значений          table with one column "field" containing the values for multiple entries
     $form:files.поле      $form:files.field
         hash со значениями полей типа файл, ключи - 0, 1, ..., значение - файл          hash with file-type field values, keys - 0, 1, ..., value - file
     $form:imap      $form:imap
         хеш с ключами 'x' и 'y' со значением ?1,2 приписки при использовании server-site image map          a hash with keys 'x' and 'y' with ?1,2 suffixes when using server-side image map
   
 env  
     $env:переменная  
     $env:fields хеш с переменными окружения  
     $env:PARSER_VERSION версия парсера  
   
 cookie  
     $cookie:имя считать старое или свежезаданное  
     $cookie:имя[значение] на 90 дней  
     $cookie:имя[$.value[значение] $.expires[ЗНАЧЕНИЕ] $.secure(true) $.domain[имя домена] $.httponly(true)]  
         значение поля expires может быть 'session', date, или число дней (0дней=session)  
         если дата, она будет преобразована к формату "Sun, 25-Aug-2002 12:03:45 GMT"  
     $cookie:fields  
         hash со всеми cookies  
   
 request  
     $request:query  
     $request:uri  
     $request:document-root  
         каталог, относительно которого считаются пути в parser, по-умолчанию = $env:DOCUMENT_ROOT  
     $request:argv  
         hash с параметрами коммандной строки. ключи 0, 1, ... [0 -- имя обрабатываемого файла]  
     $request:charset  
         кодировка исходного документа   
         используется при upper/lower и match[][i]  
         ПРЕДУПРЕЖДЕНИЕ: необходимо задать $request/response:charset до использования полей класса form  
     $request:method  
         метод запроса (GET|POST|PUT)  
     $request:body  
         тело POST-запроса в виде текста  
     $request:body-file  
         тело POST-запроса в виде файла  
     $request:body-charset  
         кодировка POST-запроса  
     $request:headers  
         хеш с заголовками запроса (без префикса HTTP_)  
   
 response  inet
     $response:поле[значение]  и можно считать старое - $response:поле      ^inet:ntoa(long)
         значение может быть string а может быть hash:      ^inet:aton[IP]
             $value[abc] field: {abc}<<часть      ^inet:name2ip[name][[ $.ipv[4|6|any] $.table(true) ]]
             $attribute[zzz] field: abc; {attribute=zzz}<<часть          direct conversion of a name to an IP address
         значение поля или атрибута может быть string или date      ^inet:ip2name[ip][ $.ipv[4|6|any] ]
             если дата, она будет преобразована к формату "Sun, 25-Aug-2002 12:03:45 GMT"          reverse conversion from IP address to name
     $response:headers      ^inet:hostname[]
         накопленные поля          host name
     $response:body[DATA]  
         замещает стандартный ответ  
     $response:download[DATA]  
         замещает стандартный ответ, выставляет флаг, заставляющий browser предложить download  
     $response:status  
     ^response:clear[] забыть все заданные response поля  
     $response:charset  
         кодировка клиента т.е. та,  
         1) из которой будут перекодированы $form:поля после забирания из browser'а  
         2) в которую документ будет перекодирован перед отдаванием в browser  
         3) в которую будет перекодирован текст языка uri  
         не добавляет к content-type ничего, если хочется, это надо сделать вручную  
         ПРЕДУПРЕЖДЕНИЕ: необходимо задать $request/response:charset до использования полей класса form  
   
 regex  json
     в выражении      ^json:parse[-json-string-[;
         логическое значение всегда равно true          $.depth(maximum depth, default == 19)
         числовое значение равно количеству байт скомпилированного шаблона          $.double(false)              disable built-in parsing of floating-point numbers (enabled by default)
     ^regex::create[шаблон-строка|regex][[опции поиска]]                                       in this case they will appear in the resulting object as strings
     ^шаблон.size[]          $.int(false)                 disable built-in parsing of integers (enabled by default)
         количество байт скомпилированного шаблона                                       in this case they will appear in the resulting object as strings
         если значение очень большое - стоит почитать документацию по pcre и, возможно, переписать шаблон          $.distinct[first|last|all]   how duplicate keys in objects are handled
     ^шаблон.study_size[]                                       first - keep the first encountered element
         размер study-структуры. если==0 - шаблон не может быть "изучен"                                       last  - keep the last encountered element
     $шаблон.pattern                                       all   - keep all elements. starting from the 2nd,
         текст шаблона                                                they get numeric suffixes (key_2 etc)
     $шаблон.options                                       by default duplicate keys cause an exception
         строка с исходным текстом опций          $.object[method-junction]    user method[key;object], called for all parsed
                                        objects and object keys; method returns a new object
           $.array[method-junction]     user method called for arrays
           $.taint[taint language]      sets the transformation language for all result strings
       ]]
           parses a json-string into a hash
   
 reflection      ^json:string[system or user object[;
     ^reflection:create[класс;конструктор[;пара[;мет[;ры]]]]          $.skip-unknown(false)    disable exception and output 'null' when serializing objects of types
         вызывает указанный конструктор класса (не более 100 параметров)                                   other than void, bool, string, int, double, date, table, hash, and file
     ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[па] $.2[рам] $.3[етры] ] ]          $.indent(true)           format the resulting string with indentation according to nesting depth
         вызывает указанный конструктор класса          $.date[sql-string|gmt-string|iso-string|unix-timestamp]
     ^reflection:classes[]                                   date output format, default = sql-string
         хеш со всеми классами. ключ = имя класса, значение бывает methoded (класс с методами) или void          $.table[object|array|compact]
     ^reflection:class[объект]                                   format for tables, default=object
         класс переданного объекта                                   object: [{"c1":"v11","c2":"v12",...},{"c1":"v21","c2":"v22",...},...]
     ^reflection:class_name[объект]                                   array:  [["c1","c2",...] || null (for nameless),["v11","v12",...],...]
         имя класса переданного объекта                                   compact: ["v11" || ["v11","v12",...],...]
     ^reflection:base[объект]          $.file[text|base64|stat] output file content in the specified mode (by default file content
         родительский класс переданного объекта                                   is not included in output)
     ^reflection:base_name[объект]          $.xdoc[hash]             parameters for converting xdoc to string (as in ^xdoc.string[])
         имя родительского класса переданного объекта          $.type[method-junction]  any type can be output using a user method
     ^reflection:class_by_name[имя класса]                                   that must take 3 parameters: key, object of that type, and options
         получение класса по имени                                   of the ^json:string[] call
     ^reflection:class_alias[имя класса;новое имя класса]          $._default[method]       user method, called to output all user-class objects.
         задает псевдоним для указанного класса                                   The method must take 3 parameters: key, object, and call options.
     ^reflection:def[class;имя класса]          $._default[method name]  method name of a user method, if present it will be called for serialization
         проверка класса на существование          $.void[null|string]      undefined value will be output as null (default)
     ^reflection:methods[класс]                                   or as an empty string
         хеш со списком методов указанного класса, значения - строки 'native' или 'parser'      ]]
     ^reflection:method[класс или объект;имя метода]          serializes a system or user object into a json-string
         возвращает junction-method класса или объекта  
     ^reflection:filename[объект или класс или метод]  
         возвращает имя файла, где определен объект, класс или метод  
     ^reflection:fields[класс или объект]  
         хеш со списком статических полей указанного класса или динамических полей указанного объекта  
     ^reflection:fields_reference[объект]  
         редактируемый хеш динамических полей указанного объекта  
     ^reflection:field[класс или объект;имя поля]  
         возвращает значение указанного поля класса или объекта. getter-ы игнорируются.  
     ^reflection:copy[источник;назначение]  
         копирует поля из одного объекта или класса в другой  
     ^reflection:uid[класс или объект]  
         возвращает идентификатор объекта или класса  
     ^reflection:method_info[класс;метод]  
         хеш с параметрами указанного метода класса  
         $.inherited[класс]  имя класса, где метод был определён (возвращается только если метод был определён в предке)  
         $.overridden[класс] имя класса, где метод был определён (возвращается только если метод был определён в предке)  
         для native классов возвращается хеш:  
             .min_params(минимально необходимое число параметров)  
             .max_params(максимально возможное число параметров)  
             .call_type[dynamic|static|any]  
         для parser классов возвращается хеш:  
             ключ - номер параметра (0, 1, ...), значение - имя параметра  
     ^reflection:dynamical[[object or class, caller if absent]]  
         возвращает true, если метод был вызван из динамического контекста при передаче  
         параметра возвращает true, если передан динамический объект, false если класс  
     ^reflection:delete[класс или объект;имя переменной]  
         удаляет переменную с указанным именем в указанном классе или объекте  
     ^reflection:is[имя элемента;имя класса][[контекст]]  
         аналог оператора 'is', позволяющий определить, является ли элемент кодом.  
     ^reflection:tainting[[язык|tainted|optimized];строка]  
         строка, в которой каждому символу исходной строки соотвествует символ с кодом преобразования  
     ^reflection:stack[ $.args(false/true) $.locals(false/true) $.limit(n) $.offset(o)]  
         текущее состояние стека вызовов методов на парсере  
     ^reflection:mixin[источник; $.to[получатель] $.name[имя] $.methods(true/false) $.fields(true/false) $.overwrite(false/true) ]  
         копирует в класс методы и поля другого класса  
   
 mail  mail
     $mail.received=MESSAGE:      $mail.received=MESSAGE:
         .from          .from
         .reply-to          .reply-to
         .subject          .subject
         .date класса date          .date of class date
         .message-id          .message-id
         .raw[          .raw[
             .СЫРОЕ_ПОЛЬЗОВАТЕЛЬСКОЕ-ПОЛЕ-ЗАГОЛОВКА              .RAW_USER_HEADER_FIELD
         ]          ]
         $.{text|html|file#}[ << нумеруется как и в mail:send (text, text2, ...) (file, file2, ...)          $.{text|html|file#}[ << numbered as in mail:send (text, text2, ...) (file, file2, ...)
             $.content-type[              $.content-type[
                 $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}]                  $.value[{text|...|x-unknown}/{plain|html|...|x-unknown}]
                 [$.charset[windows-1251]] << в каком пришло, сейчас уже перекодировано                  [$.charset[windows-1251]] << in which it arrived, now already transcoded
                 $.ПОЛЬЗОВАТЕЛЬСКИЙ-ПАРАМЕТР-ЗАГОЛОВКА                  $.USER_DEFINED_HEADER_FIELD
             ]              ]
             $.description              $.description
             $.content-id              $.content-id
             $.content-md5              $.content-md5
             $.content-location              $.content-location
             .raw[              .raw[
                 .СЫРОЕ_ПОЛЬЗОВАТЕЛЬСКОЕ-ПОЛЕ-ЗАГОЛОВКА                  .RAW_USER_HEADER_FIELD
             ]              ]
             $.value[строка|FILE]              $.value[string|FILE]
         ]          ]
         $.message#[MESSAGE] (message, message2, ...)          $.message#[MESSAGE] (message, message2, ...)
   
     ^mail:send[      ^mail:send[
         $.options[-odd]          $.options[-odd]
             unix: строка, которая будет добавлена к команде запуска sendmail              unix: a string that will be added to the sendmail startup command
                 -odd означает "быстро поставь в очередь без проверки email"                  -odd means "quickly put in the queue without email checking"
             win32: игнорируется              win32: ignored
         $.charset[кодировка заголовка и текстовых блоков]          $.charset[the encoding of the headers and text blocks]
         $.any-header-field          $.any-header-field
         $.text[string]          $.text[string]
         $.text[          $.text[
            $.any-header-field              $.any-header-field
            $.value[string]              $.value[string]
         ]          ]
         $.html{string}          $.html{string}
         $.html[          $.html[
Line 750  mail Line 879  mail
             $value[FILE]              $value[FILE]
         ]          ]
     ]      ]
     если charset указан, письмо перекодируется в этот charset      if charset is specified, the email is transcoded to this charset
     content-type.charset не влияет на перекодирование      content-type.charset does not affect transcoding
     после имени части может идти # число      after the part name a # number can follow
   
     ^mail:send[      ^mail:send[
 #       по-умолчанию, совпадает с source encoding.  #       by default, matches the source encoding.
 #       задаёт кодировку body  #       sets the body encoding
         $.charset[windows-1251]          $.charset[windows-1251]
 #       нет умолчания  #       no default
         $.content-type[$.value[text/plain] $.charset[windows-1251]]          $.content-type[$.value[text/plain] $.charset[windows-1251]]
         $.from["вася" <vasya@design.ru>]          $.from["vasya" <vasya@design.ru>]
         $.to["петя" <petya@design.ru>]          $.to["petya" <petya@design.ru>]
         $.subject[тема]          $.subject[subject]
         $.body[          $.body[
             слова              text
         ]          ]
     ]      ]
   
     ^mail:send[$.header-field[] $.charset[кодировка письма] $.body[когда body не строка, а hash, отсылается multipart письмо]]      ^mail:send[$.header-field[] $.charset[mail encoding] $.body[if body is not a string, but a hash, a multipart email is sent]]
         если charset указан, письмо перекодируется в этот charset          if charset is specified, the email is transcoded to that charset
         content-type.charset не влияет на перекодирование          content-type.charset does not affect transcoding
         после имени части может идти целое число, части пойдут в порядке чисел.          after the part name, an integer can follow, parts go in numerical order.
         если body указан строкой, то это текст письма, никаких вложений.          if body is a string, then it's just the email text, no attachments.
         если body указан hash, то это части, будут собраны текстовые блоки, затем вложения          if body is a hash, then these are parts, text blocks first, then attachments
         это старый формат, поддерживается для обратной совместимости          this is the old format, supported for backward compatibility
         если имя части начинается со слова text, то это текстовый блок.          if the part name begins with "text", it's a text block.
         если имя части начинается со слова file, то это вложение, формат задания:          if the part name begins with "file", it's an attachment, format:
             $file[$.format[uue|base64] $.value[DATA] $.name[user-file-name]]              $file[$.format[uue|base64] $.value[DATA] $.name[user-file-name]]
         важно: при multipart не указывать content-type          important: for multipart do not specify content-type
   
         ^mail:send[          ^mail:send[
 #           по-умолчанию, совпадает с source encoding  #           by default, matches the source encoding
 #           задаёт кодировку body  #           sets the body encoding
             $.charset[windows-1251]              $.charset[windows-1251]
 #           нет умолчания  #           no default
             $.content-type[$.value[text/plain] $.charset[windows-1251]]              $.content-type[$.value[text/plain] $.charset[windows-1251]]
             $.from["вася" <vasya@design.ru>]              $.from["vasya" <vasya@design.ru>]
             $.to["петя" <petya@design.ru>]              $.to["petya" <petya@design.ru>]
             $.subject[тема]              $.subject[subject]
             $.body[              $.body[
                 слова                  text
             ]              ]
         ]          ]
   
         ^mail:send[          ^mail:send[
             $.from["вася" <vasya@design.ru>]              $.from["vasya" <vasya@design.ru>]
             $.to["петя" <petya@design.ru>]              $.to["petya" <petya@design.ru>]
             $.subject[тема]              $.subject[subject]
             $.body[              $.body[
                 $.text[                  $.text[
 #                   задаёт кодировку body  #                   sets the body encoding
                     $.charset[windows-1251]                      $.charset[windows-1251]
 #                   нет умолчания  #                   no default
                     $.content-type[$.value[text/plain] $.charset[windows-1251]]                      $.content-type[$.value[text/plain] $.charset[windows-1251]]
                     $.body[слова]                      $.body[words]
                 ]                  ]
 #               для удобства можно указать только одну часть, при этом не будет multipart  #               for convenience you can specify only one part, then it won't be multipart
                 $.file[                  $.file[
                     $.value[^file::load[my beloved.doc]]                      $.value[^file::load[my beloved.doc]]
                     $.name[my beloved.doc]                      $.name[my beloved.doc]
Line 818  mail Line 947  mail
                 ]                  ]
             ]              ]
         ]          ]
     для отправки под unix используется программа с параметрами, задаваемая      under unix, the program with arguments is used, set by
         $MAIL.sendmail[команда]          $MAIL.sendmail[command]
     если не будет задана, проверяется, доступна ли /usr/sbin/sendmail или      if not specified, checks if /usr/sbin/sendmail or
     /usr/lib/sendmail и, если доступна, то запускается с параметром "-t".      /usr/lib/sendmail is available and if so, runs with "-t".
   
     под Windows используется SMTP протокол, сервер задаётся      under Windows, SMTP protocol is used, server is set by
         $MAIL.SMTP[smtp.domain.ru]          $MAIL.SMTP[smtp.domain.ru]
   
 image  
     $картинка[^image::measure[DATA[; $.exif(bool) $.xmp(bool) $.xmp-charset[] $.video(bool) ]]]  
         смотрит на .ext case insensitive,  
         умеет мерить gif, jpg, tiff, bmp, webp и mp4 (mov)  
     $картинка.exif << hash после measure jpeg с exif информацией и $.exif(true)  
         $image.exif.DateTime & co  
             [полный список см. https://exiftool.org/TagNames/EXIF.html]  
         числа типа int/double,  
         даты типа dateб  
         перечисления в виде hash с ключами 0..count-1  
     $картинка.src .width .height  
     $картинка.line-width  число=ширина линий  
         $картинка.line-style строка=стиль линий '*** * '='*** * *** * *** * '  
     ^картинка.html[[hash]]  
         <img ...>  
     ^image::load[фон.gif]  
         только gif пока  
     ^image::create(размер X;размер Y[;цвет фона default белый]])  
     ^картинка.line(x0;y0;x1;y1;0xffFFff)  
     ^картинка.fill(x;y;0xffFFff)  
     ^картинка.rectangle(x0;y0;x1;y1;0xffFFff)  
     ^картинка.bar(x0;y0;x1;y1;0xffFFff)  
     ^картинка.replace(hex-цвет1;hex-цвет2)[table x:y вершины_многоугольника]  
     ^картинка.polyline(цвет)[table x:y точки]  
     ^картинка.polygon(цвет)[table x:y вершины_многоугольника]  
     ^картинка.polybar(цвет)[table x;y вершины_многоугольника]  
     ^картинка.font[набор_букв;имя_файла_шрифта.gif][(ширина_пробела[;ширина_символа])]  
         высота символа = высота картинки/количество букв в наборе  
         если указана ширина_символа, то monospaced, если 0, то ширина_символа = ширине gif  
     ^картинка.font[набор_букв;имя_файла_шрифта.gif;  
         $.space(ширина_пробела)             // по умолчанию = ширине gif  
         $.width(ширина_символа)             // см. выше, по умолчанию proportional  
         $.spacing(расстояние между буквами) // по умолчанию = 1  
     ]  
     ^картинка.text(x;y)[текст_надписи] AS_IS  
     ^картинка.length[текст_надписи] AS_IS  
     ^картинка.gif[возможно, имя файла]  
         кодирует в FILE с content-type=image/gif имя файла будет использовано при $response:download  
     ^картинка.arc(center x;center y;width;height;start in degrees;end in degrees;color)  
     ^картинка.sector(center x;center y;width;height;start in degrees;end in degrees;color)  
     ^картинка.circle(center x;center y;r;color)  
     ^картинка.copy[source](src x;src y;src w;src h;dst x;dst y[;dest w[;dest h[;tolerance]]])  
         при заданных dest_w/dest_h делает изменение размера кусочка  
             при уменьшении делает resample  
             годится только для уменьшения простой[малоцветной] дребедени вроде графиков/pie,  
             для thumbnais не годится  
         при не указанном dest_h сохраняет aspect ratio  
         tolerance - некое число[квадрат расстояния в RGB пространстве до искомого цвета],  
         определяющее прожорливость выделялки цветов из палитры [default=150]  
             меньше - точнее приближает цвета, но они быстро кончаются  
             больше - неточно приближает цвет, но большей части хватит  
     ^картинка.pixel(x;y)[(color)]  
         узнать или задать цвет пиксела  
   
 file  
     $файл_из_post.name  
     $файл_из_post.size  
     $файлt_из_post.text  
     ^файл.save[text|binary;имя файла[;$.charset[в какой кодировке сохраняем]]]  
     ^file:delete[имя файла]  
     ^file:find[имя файла][{когда не нашли}]  
     ^file:list[путь[;шаблон-строка|шаблон-regex]]  
         table с колонками name dir  
     ^file:list[путь;$.filter[шаблон-строка|шаблон-regex] $.stat(true)]  
         table с колонками name dir size [mca]date  
     ^file::load[text|binary;big.zip[;domain_press_release_2001_03_01.zip][;опции]]  
     ^file::create[text|binary;имя;data]  
     ^file::create[text|binary;имя;data[;$.charset[кодировка букв в создаваемом файле] $.content-type[...]]]  
     ^file::create[string-or-file-content[;$.name[имя] $.mode[text|binary] $.content-type[...] $.charset[...]]]  
     $файл_который_был_loaded.size  
     $файл_который_был_loaded_или_created.mode = text/binary  
     ^file::stat[имя файла]  
     $файл_который_был_stated_или_loaded.size .adate .mdate .cdate  
     ^file::cgi[[text|binary;]имя файла[;env hash +options[;1cmd[;2line[;3ar[;4g[;5s]]]]]]]  
         любой аргумент может быть строкой или массивом строк  
         возвращённый заголовок рассыпается на $поля  
         $status  
         $stderr  
     ^file::exec[[text|binary;]имя файла[;env hash[;1cmd[;2line[;3ar[;4g[;5s;...under unix max 50 args]]]]]]]  
         любой аргумент может быть строкой или массивом строк  
         options:  
             $.stdin[текст|файл] если пусто, отключается автоматическое пересовывание данных HTTP-POST  
     ^file:move[старое имя файла;новое имя файла]  
         можно переименовывать и двигать каталоги[win32: но не через границу дисков]  
         каталоги для dest создаются с правами 775  
         каталог старого файла стирается, если после move он остаётся пуст  
     ^file:copy[имя файла;имя копии файла[; $.append(1) ]]  
         можно копировать только файлы  
     ^file:lock[имя файла]{код}  
         файл при необходимости создаётся  
         блокируется  
         выполняется код  
         разблокируется  
     ^file:dirname[/a/some.tar.gz|file]=/a (работает аналогично комманде *nix)  
     ^file:dirname[/a/b/|file]=/a (работает аналогично комманде *nix)  
     ^file:basename[/a/some.tar.gz|file]=some.tar.gz (работает аналогично комманде *nix)  
     ^file:basename[/a/b/|file]=b (работает аналогично комманде *nix)  
     ^file:justname[/a/some.tar.gz|file]=some.tar  
     ^file:justext[/a/some.tar.gz|file]=gz  
     /some/page.html: ^file:fullpath[a.gif] => /some/a.gif  
     ^файл.sql-string[]  
         внутри ^connect даст правильно escaped строку, которую можно в запрос отдать  
     ^file::sql{query}[[ $.name[имя_файла_для_download] $.content-type[пользовательский content-type] ]]  
         результат запроса должен быть "одна строка".  
         колонки:  
         первая колонка - данные  
         если есть вторая - это имя файла  
         если есть третья - это content-type  
     ^файл.base64[ $.pad(bool) $.wrap(bool) $.url-safe(bool) ]  
         encode  
     ^file:base64[имя файла[; $.pad(bool) $.wrap(bool) $.url-safe(bool) ]]  
         encode  
     ^file::base64[encoded string[; $.pad(bool) $.strict(bool) url-safe(bool) ]]  
         decode  
     ^file::base64[mode;имя файла;encoded string[; $.content-type[...] $.pad(bool) $.strict(bool) url-safe(bool) ]]  
         decode  
     ^file:crc32[имя файла]  
         вычисляет crc32 файла с указанным именем  
     ^файл.crc32[]  
         вычисляет crc32 объекта  
     ^файл.md5[], ^file:md5[имя файла]  
         выдает digest файла, длиной 16 байт в виде строки,  
         где байты digest выданы в hex виде, впритык, в нижнем регистре  
   
 math  math
     $math:PI      $math:PI
     ^math:round floor ceiling      ^math:round floor ceiling
Line 959  math Line 964  math
     ^math:sin asin cos acos tan atan atan2      ^math:sin asin cos acos tan atan atan2
     ^math:degrees radians      ^math:degrees radians
     ^math:pow sqrt      ^math:pow sqrt
     ^math:random(ширина диапазона)      ^math:random(range_width)
     ^math:convert[number|файл](base-from;base-to)[[ $.format[string|file] ]]      ^math:convert[number|file](base-from;base-to)[[ $.format[string|file] ]]
     ^math:convert[number|файл][алфавит](base-to)[[ $.format[string|file] ]]      ^math:convert[number|file][alphabet](base-to)[[ $.format[string|file] ]]
     ^math:convert[number|файл](base-from)[алфавит][[ $.format[string|file] ]]      ^math:convert[number|file](base-from)[alphabet][[ $.format[string|file] ]]
         преобразует строку или файл с числом из одной системы исчисления в другую          converts a string or file with a number from one numeral system to another
         система счисления может быть задана алфавитом, числом от 2 до 16 (эквивалентно алфавиту 0123456789ABCDEF), числом 256 (все ASCII символы)          the numeral system can be set by an alphabet, a number from 2 to 16 (equivalent to the alphabet 0123456789ABCDEF), or 256 (all ASCII characters)
     ^math:uuid[ $.lower(bool) $.solid(bool) ]      ^math:uuid[ $.lower(bool) $.solid(bool) ]
         22C0983C-E26E-4169-BD07-77ECE9405BA5          22C0983C-E26E-4169-BD07-77ECE9405BA5
         win32: пользуется cryptapi          win32: uses cryptapi
         unix: пользуется /dev/urandom,          unix: uses /dev/urandom,
             если нет, /dev/random,              if not present, /dev/random,
             если нет, rand              if not, rand
     ^math:uuid7[ $.lower(bool) $.solid(bool) ]      ^math:uuid7[ $.lower(bool) $.solid(bool) ]
         0193CBF0-7898-7000-A391-AC513CC15658          0193CBF0-7898-7000-A391-AC513CC15658
         https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7          https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7
     ^math:uid64[ $.lower(bool) ]      ^math:uid64[ $.lower(bool) ]
         BA39BAB6340BE370          BA39BAB6340BE370
     ^math:md5[string]      ^math:md5[string]
         выдает digest строки, длиной 16 байт в виде строки,           returns the digest of the string, 16 bytes as a string,
         где байты digest выданы в hex виде, впритык, в нижнем регистре          bytes in hex, contiguous, lowercase
     ^math:crypt[password;salt]      ^math:crypt[password;salt]
         salt prefix $apr1$ вызывает встроенный MD5 алгоритм,          salt prefix $apr1$ triggers built-in MD5 algorithm,
         если нет тела salt, оно создаётся случайным          if salt body is empty, it is generated randomly
         $1$ вызывает MD5 алгоритм функции OS 'crypt', если поддерживается.          $1$ calls the OS 'crypt' MD5 algorithm if supported.
         другие salt читайте документацию по функции OS 'crypt'.          for other salts see OS 'crypt' documentation.
     ^math:crc32[string]      ^math:crc32[string]
         вычисляет crc32 строки          calculates crc32 of the string
     ^math:sha1[string]      ^math:sha1[string]
     ^math:digest[[md5|sha1|sha256|sha512];строка или файл][[ $.format[hex|base64|file] $.hmac[ключ строка|ключ файл] ]]      ^math:digest[[md5|sha1|sha256|sha512];string or file][[ $.format[hex|base64|file] $.hmac[key string|key file] ]]
         объединяет в себе возможность работы с разными алгоритмами криптографического хеширования.          combines the ability to use various cryptographic hashing algorithms.
         $.hmac[ключ] для проверки целостности переданных данных          $.hmac[key] for verifying the integrity of transmitted data
   
 inet  memory
     ^inet:ntoa(long)      ^memory:compact[]
     ^inet:aton[IP]          collect garbage, freeing space for new data (warning: process memory is never released)
     ^inet:name2ip[name][[ $.ipv[4|6|any] $.table(true) ]]          useful before XSL transform
         прямое преобразование имени в IP адрес      ^memory:auto-compact(frequency)
     ^inet:ip2name[ip][ $.ipv[4|6|any] ]]          sets automatic garbage collection frequency, from 0 (off) up to 5 (max)
         обратное преобразование из IP адреса в имя  
     ^inet:hostname[]  
         имя хоста  
   
 json  reflection
     ^json:parse[-json-строка-[;      ^reflection:create[class;constructor[;pa[;ra[;ms]]]]
         $.depth(максимальная глубина, default == 19)          calls the specified class constructor (no more than 100 parameters)
         $.double(false)              отключить встроенный парсинг чисел с плавающей точкой (по умолчанию включен)      ^reflection:create[ $.class[name] $.constructor[name] $.arguments[ $.1[pa] $.2[ra] $.3[ms] ] ]
                                      в этом случае они попадут в результирующий объект как строки          calls the specified class constructor
         $.int(false)                 отключить встроенный парсинг целых чисел (по умолчанию включен)      ^reflection:classes[]
                                      в этом случае они попадут в результирующий объект как строки          a hash of all classes. key = class name, value can be methoded (a class with methods) or void
         $.distinct[first|last|all]   как будет происходить разбор дублирующихся ключей у объектов      ^reflection:class[object]
                                      first - будет оставлен первый встретившийся элемент          the class of the given object
                                      last  - будет оставлен последний встретившийся элемент      ^reflection:class_name[object]
                                      all   - будут оставлены все элементы. при этом элементы, начиная со 2          the class name of the given object
                                               получат числовые суффиксы (key_2 итд)      ^reflection:base[object]
                                      по умолчанию дублирующиеся ключи приведут к exception          the parent class of the given object
         $.object[method-junction]    пользовательский метод[ключ;объект], которому будут передаваться все разобранные       ^reflection:base_name[object]
                                      объекты и ключи объекта, метод возвращает новый объект          the parent class name of the given object
         $.array[method-junction]     пользовательский метод, которому будут передаваться массивы      ^reflection:class_by_name[class name]
         $.taint[язык преобразования] задаёт язык преобразования для всех строк результата          obtains the class by name
     ]]      ^reflection:class_alias[class name;new class name]
         парсит json-строку в хеш          sets an alias for the specified class
       ^reflection:def[class;class name]
           checks if the class exists
       ^reflection:methods[class]
           a hash with a list of methods of the specified class, values are strings 'native' or 'parser'
       ^reflection:method[class or object;method name]
           returns the junction-method of the class or object
       ^reflection:filename[object or class or method]
           returns the filename where the object, class or method is defined
       ^reflection:fields[class or object]
           a hash with the list of static fields of the specified class or dynamic fields of the specified object
       ^reflection:fields_reference[object]
           an editable hash of the dynamic fields of the specified object
       ^reflection:field[class or object;field name]
           returns the value of the specified field of the class or object. getters are ignored.
       ^reflection:copy[source;destination]
           copies fields from one object or class to another
       ^reflection:uid[class or object]
           returns the identifier of the object or class
       ^reflection:method_info[class;method]
           a hash with parameters of the specified class method
           $.inherited[class] name of the class where the method was defined (returned only if the method was defined in an ancestor)
           $.overridden[class] name of the class where the method was defined (returned only if the method was defined in an ancestor)
           for native classes a hash is returned:
               .min_params(minimum required number of parameters)
               .max_params(maximum possible number of parameters)
               .call_type[dynamic|static|any]
           for parser classes a hash is returned:
               key is parameter number (0, 1, ...), value is parameter name
       ^reflection:dynamical[[object or class, caller if absent]]
           returns true if the method was called from a dynamic context when passing
           a parameter returns true if a dynamic object was passed, false if a class
       ^reflection:delete[class or object;variable name]
           deletes the variable with the specified name in the specified class or object
       ^reflection:is[element name;class name][[context]]
           analogous to the 'is' operator, allowing to determine if the element is code.
       ^reflection:tainting[[language|tainted|optimized];string]
           a string in which each character of the original string corresponds to a character with a transformation code
       ^reflection:stack[ $.args(false/true) $.locals(false/true) $.limit(n) $.offset(o)]
           the current state of the method call stack in the parser
       ^reflection:mixin[source; $.to[target] $.name[name] $.methods(true/false) $.fields(true/false) $.overwrite(false/true)]
           copies methods and fields from one class to another
   
     ^json:string[system or user object[;  request
         $.skip-unknown(false)    отключить exception и выдавать 'null' при сериализации объектов с типами      $request:query
                                  отличных от void, bool, string, int, double, date, table, hash и file      $request:uri
         $.indent(true)           форматировать результирующую строку табуляциями по глубине вложенности      $request:document-root
         $.date[sql-string|gmt-string|iso-string|unix-timestamp]          directory relative to which paths are considered in parser, default = $env:DOCUMENT_ROOT
                                  формат вывода даты, по умолчанию -- sql-string      $request:argv
         $.table[object|array|compact]          hash with command-line parameters. keys 0, 1, ... [0 - name of the processed file]
                                  формат вывода таблицы, по умолчанию -- object      $request:charset
                                  object: [{"c1":"v11","c2":"v12",...},{"c1":"v21","c2":"v22",...},...]          the source document encoding
                                  array:  [["c1","c2",...] || null (for nameless),["v11","v12",...],...]          used in upper/lower and match[][i]
                                  compact:  ["v11" || ["v11","v12",...],...]          WARNING: you must set $request/response:charset before using form class fields
         $.file[text|base64|stat] вывести тело файла в указанном виде (по умолчание тело файла       $request:method
                                  не попадает в output)          request method (GET|POST|PUT)
         $.xdoc[hash]             параметры преобразования xdoc в строку (как в ^xdoc.string[])      $request:body
         $.тип[method-junction]   любой тип можно вывести с помощью пользовательского метода, который           POST-request body as text
                                  должен принимать 3 параметра: ключ, объект данного типа и опции       $request:body-file
                                  вызова ^json:string[]          POST-request body as a file
         $._default[метод]        пользовательский метод, будет вызываться для вывода всех объектов пользовательских      $request:body-charset
                                  классов. Метод должен принимать 3 параметра: ключ, объект и опции вызова.          POST-request encoding
         $._default[имя метода]   имя пользователького метода, при его наличии он будет вызван для сериализации      $request:headers
         $.void[null|string]      неопределенное значение будет выдано в виде null (по умолчанию)          hash with request headers (without HTTP_ prefix)
                                  или пустой строки  
     ]]  
         сериализует системный или пользовательский объект в json-строку  
   
 date  response
     время типа date можно использовать в выражениях, подставляет количество дней с epoch [1 января 1970 (UTC)], дробное      $response:field[value] and can read old - $response:field
     строковое значение в местном времени, численное в UTC, диапазон от 0000-00-00 00:00:00 до 9999-12-31 23:59:59          the value can be string or hash:
     по умолчанию используется установленная средствами OS временная зона              $value[abc] field: {abc}<<part
               $attribute[zzz] field: abc; {attribute=zzz}<<part
           field or attribute value can be string or date
               if date, it will be converted to "Sun, 25-Aug-2002 12:03:45 GMT"
       $response:headers
            accumulated fields
       $response:body[DATA]
           replaces the standard response
       $response:download[DATA]
           replaces the standard response, sets a flag causing the browser to suggest download
       $response:status
       ^response:clear[] forget all set response fields
       $response:charset
           client encoding, i.e.:
           1) from which $form: fields will be transcoded after retrieval from browser
           2) into which the document will be transcoded before sending to browser
           3) into which URI language text will be transcoded
           does not add anything to content-type; if needed, do it manually
           WARNING: you must set $request/response:charset before using form class fields
   
     ^date::now[]  status
     ^date::now(смещение в днях)      $status:sql
         выдаёт сейчас+смещение          cache table
     ^date::today[]              url    time
         дата на 00:00:00 текущего дня              url    time
     ^date::today(целочисленное смещение в днях)              url    time
         дата на 00:00:00 текущего дня+смещение      $status:stylesheet
     ^date::create(дней с epoch)          cache table
     ^date::create(year;month[;day[;hour[;minute[;second[;TZ]]]]])              file    time
     ^date::create[дата в формате %Y-%m-%d %H:%M:%S]              file    time
         для удобного создания по значению из базы              file    time
         формат1: %Y[-%m[-%d[ %H[:%M[:%S]]]]]      $status:rusage hash
         формат2: %H:%M[:%S]          utime user time used
     ^date::create[дата в формате %Y-%m-%dT%H:%M[:%S]TZ]          stime system time used
         для создания по значению в формате ISO 8601          maxrss max resident set size
         формат TZ: Z(UTC) или +-hour[:minute] (смещение от UTC)          ixrss integral shared text memory size
     ^date::unix-timestamp()          idrss integral unshared data size
     ^дата.unix-timestamp[]          isrss integral unshared stack size
     $дата.year month day hour minute second weekday yearday(0...) daylightsaving TZ weekyear          tv_sec
         TZ="" << локальная зона          tv_usec
     $дата.year month day hour minute second можно задать новое значение, остальные read only             $s[$status:rusage]
     ^дата.double[] ^дата.int[]             ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f]
         количество дней с epoch [1 января 1970 (UTC)], дробное или целое      $status:memory hash
     ^дата.roll[year|month|day](+-смещение)          used
         сдвигает дату              includes some pages that were allocated but never written
     ^дата.roll[TZ;Новая зона]          free
         говорит, что дата в таком-то часовом поясе: влияет на .hour & Co          ever_allocated_since_compact
     ^date:roll[TZ;Новая зона]              return the number of bytes allocated since the last collection
         говорит, что по умолчанию все даты в таком-то часовом поясе          ever_allocated_since_start
     ^дата.sql-string[[datetime|date|time]]              return the total number of bytes [EVER(c)PAF] allocated in this process,
         datetime или без параметра - %Y-%m-%d %H:%M:%S              never decreases
         date                       - %Y-%m-%d      $status:pid
         time                       - %H:%M:%S          process id
         where published='^дата.sql-string[]'      $status:tid
     ^date:calendar[rus|eng](год;месяц)          thread id
         выдаёт неименованную таблицу, столбцы: 0..6, week, year      $status:mode
     ^date:calendar[rus|eng](год;месяц;день)          working mode, cgi|console|mail|httpd|apache|isapi
         выдаёт именнованную таблицу, столбцы: year, month, day, weekday      $status:log-filename
     ^date:last-day(год;месяц)          path to parser3.log error log
         вернёт последний день месяца  
     ^дата.last-day[]  
         вернёт последний день месяца $дата  
     ^дата.gmt-string[]  
         Fri, 23 Mar 2001 09:32:23 GMT  
     ^дата.iso-string[]  
         2001-03-23T12:32:23+03  
   
 xdoc(xnode)  xdoc(xnode)
     $xdoc.search-namespaces hash, where keys=prefixes, values=urls      $xdoc.search-namespaces hash, where keys=prefixes, values=urls
Line 1123  xdoc(xnode) Line 1174  xdoc(xnode)
         Implementations that do not know whether attributes are of type ID or not          Implementations that do not know whether attributes are of type ID or not
         are expected to return null.          are expected to return null.
   
     кодировка строк и умолчание для $.encoding равно текущей кодировке выходной страницы, $response:charset      String encoding and default for $.encoding equals the current output page encoding, $response:charset
   
     ::sql{...}      ::sql{...}
     ::create[[URI]]{<?xml?><string/>} старое имя 'set'      ::create[[URI]]{<?xml?><string/>} old name 'set'
     ::create[[URI]][qualifiedName]      ::create[[URI]][qualifiedName]
       URI default = disk path to requested document          URI default = disk path to requested document
       для каталогов конечный / обязателен          for directories a trailing / is mandatory
     ::create[file] can be usable:      ::create[file] can be usable:
         $f[^file::load[binary;http://;some HTTP options here...]]          $f[^file::load[binary;http://;some HTTP options here...]]
         $x[^xdoc::create[$f]]          $x[^xdoc::create[$f]]
     ::load[file.xml[;опции]]      ::load[file.xml[;options]]
     .transform[rules.xsl|xdoc][[params hash]] выдаёт dom      .transform[rules.xsl|xdoc][[params hash]] returns dom
         шаблон кешируется, кеш обновляется при изменении даты файла шаблона,          the template is cached, cache is updated if the template file date changes,
         или изменении даты файла "имя шаблона.stamp"[проверка даты stamp приоритетнее]          or the date of "template_name.stamp" changes [stamp date check has priority]
         <xsl:output          <xsl:output
         method = "xml" | "html" | "text"          method = "xml" | "html" | "text"
         version = nmtoken          version = nmtoken
Line 1146  xdoc(xnode) Line 1197  xdoc(xnode)
         cdata-section-elements = qnames          cdata-section-elements = qnames
         indent = "yes" | "no"          indent = "yes" | "no"
         media-type = string />          media-type = string />
         параметры передаются как есть, не xpath выражения          parameters are passed as is, not xpath expressions
   
     .string[[output options]]      .string[[output options]]
     .save[file.xml[;output options]] с шапкой      .save[file.xml[;output options]] with header
     .file[[output options]] = file      .file[[output options]] = file
         output options идентичны атрибутам xsl:output          output options are identical to xsl:output attributes
             [исключение: игнорируется cdata-section-elements, нужно будет, сделаю]              [exception: cdata-section-elements ignored]
         выдаёт media-type при подстановке $response:body[сюда]          returns media-type when substituting $response:body[here]
   
     если на документ ссылаются так:      if the document is referenced as:
         parser://method/param/to/that/method          parser://method/param/to/that/method
         то в качестве документа используется ^MAIN:method[/param/to/that/method]          then ^MAIN:method[/param/to/that/method] is used as the document
         [примечание: в параметр всегда приходит лидирующая /, даже, если параметров вообще не было]          [note: the parameter always comes with a leading /, even if there were no parameters]
   
 xnode  xnode
     DOM1 attributes:      DOM1 attributes:
Line 1240  xnode Line 1291  xnode
     boolean hasAttributes()      boolean hasAttributes()
   
     XPath:      XPath:
     ^node.select[xpath/query/expression] = array of nodes,       ^node.select[xpath/query/expression] = array of nodes,
         empty array if nothing found          empty array if nothing found
     ^node.selectSingle[xpath/query/expression] = first node if any      ^node.selectSingle[xpath/query/expression] = first node if any
     ^node.selectBool[xpath/query/expression] = bool if any or die      ^node.selectBool[xpath/query/expression] = bool if any or die
     ^node.selectNumber[xpath/query/expression] = double if any or die      ^node.selectNumber[xpath/query/expression] = double if any or die
     ^node.selectString[xpath/query/expression] = string if any or die      ^node.selectString[xpath/query/expression] = string if any or die
   
 memory  
     ^memory:compact[]  
         собрать мусор, освободив место под новые данные (предупреждение: память процесса никогда не освобождается)  
         полезно делать перед XSL transform  
     ^memory:auto-compact(частота сборки)  
         задает режим автоматической сборки мусора, от 0 (выключена) до 5 (максимальная)  
   
 status  
     $status:sql  
         cache table  
             url    time  
             url    time  
             url    time  
     $status:stylesheet  
         cache table  
             file    time  
             file    time  
             file    time  
     $status:rusage hash  
         utime user time used  
         stime system time used  
         maxrss max resident set size  
         ixrss integral shared text memory size  
         idrss integral unshared data size  
         isrss integral unshared stack size  
         tv_sec  
         tv_usec  
            $s[$status:rusage]  
            ^s.tv_sec.format[%.0f].^s.tv_usec.format[%06.0f]  
     $status:memory hash  
         used  
             includes some pages that were allocated but never written  
         free  
         ever_allocated_since_compact  
             return the number of bytes allocated since the last collection  
         ever_allocated_since_start  
             return the total number of bytes [EVER(c)PAF] allocated in this process,  
             never decreases  
     $status:pid  
         process id  
     $status:tid  
         thread id  
     $status:mode  
         режим работы, cgi|console|mail|httpd|apache|isapi  
     $status:log-filename  
         путь к журналу ошибок parser3.log  
   
 console  
     $console:timeout  
     $console:line  
         read/write строку  
   
 DATA::=string | file | hash  DATA::=string | file | hash
     hash вида      hash of the form
     [      [
         $.file[имя файла на диске]          $.file[filename on disk]
         $.name[имя файла для пользователя]          $.name[filename for user]
         $.mdate[date]          $.mdate[date]
     ]      ]
   
 MAIN  MAIN
     это класс, загружаемый на автомате из конфигурационного auto.p, кучи auto.p и запрашиваемого документа:      this is the class automatically loaded from the configuration auto.p, a bunch of auto.p and the requested document:
         конфигурационный auto.p          configuration auto.p
             cgi:              cgi:
                 1. или полный путь из переменной окружения CGI_PARSER_SITE_CONFIG или рядом с бинарником parser'а                  1. either full path from environment variable CGI_PARSER_SITE_CONFIG or next to parser binary
             isapi: windows directory              isapi: windows directory
             apache module:              apache module:
                 1) ParserConfig [can be in .htaccess]                  1) ParserConfig [can be in .htaccess]
         auto.p вниз от DOCUMENT_ROOT/ по дереву до каталога с обрабатываемым файлом включительно          auto.p goes down from DOCUMENT_ROOT/ through the directory tree to the directory of the processed file, inclusive
     класс собирается из всех этих файлов, последующие становятся родителями предыдущих      the class is assembled from all these files, subsequent ones become parents of the previous ones
     имя последнего загруженного MAIN, имён у предыдущих нет      the name of the last loaded is MAIN, previous ones have no names
   
     после загрузки MAIN класса вызывается его @main[]      after loading MAIN class, its @main[] is called
     результат которого передаётся в его @postprocess[data] if($data is string) ...      the result is passed to its @postprocess[data] if($data is string) ...
     результат которого отдаётся пользователю      the result is then returned to the user
   
 если встречается ошибка и try не задан, её можно красиво сообщить пользователю, определив  if an error occurs and try is not specified, it can be nicely reported to the user by defining
     @unhandled_exception[exception;stack]      @unhandled_exception[exception;stack]
         $exception.type  строка "тип проблемы"          $exception.type  string "type of problem"
         $exception.file $exception.lineno $exception.colno файл, строка и позиция, где случилась проблема [если не запрещены при компиляции]          $exception.file $exception.lineno $exception.colno file, line and position where the problem occurred [if not disabled at compile time]
         $exception.source строка, из-за которой случилась проблема          $exception.source line that caused the problem
         $exception.comment комментарий english          $exception.comment English comment
         stack табличка из колонок file line name,          stack table with columns file line name,
             там лежат в обратном порядке имена[name] и места вызовов[file line] операторов/методов, приведших к ошибке.              in reverse order the names[name] and places[file line] of the operators/methods that caused the error.
   
 при загрузке файла (file::load, table::load, xdoc::load) можно указать такое имя файла:  when loading a file (file::load, table::load, xdoc::load) you can specify such a filename:
     http://domain/document[?params<<deprecated, use $.form[...]]      http://domain/document[?params<<deprecated, use $.form[...]]
     а также, возможно, указать опции:      and possibly specify options:
         $.method[GET|POST|HEAD]          $.method[GET|POST|HEAD]
         $.timeout(3)  << в секундах, по-умолчанию =2          $.timeout(3)  << in seconds, default=2
         $.cookies[          $.cookies[
             $.имя[значение]              $.name[value]
         ]          ]
         $.headers[          $.headers[
             $.поле[значение] << значение имеет формат, как $response:ЗАГОЛОВОК              $.field[value] << value format like $response:HEADER
         ]          ]
         $.enctype[multipart/form-data]          $.enctype[multipart/form-data]
         $.form[          $.form[
Line 1350  MAIN Line 1349  MAIN
             $.field3[file]              $.field3[file]
         ]          ]
         $.body[string|file]          $.body[string|file]
         по-умолчанию, user-agent=parser3          default user-agent=parser3
         по-умолчанию, получение http status != 200 >> создает http.status ошибку, это можно отключить, передав $.any-status(1)          by default, getting http status != 200 >> creates http.status error, can be disabled by $.any-status(1)
         $.charset[кодировка удалённых документов по-умолчанию], если сервер вернёт content-type:charset - ОНА ПЕРЕБИВАЕТ          $.charset[default encoding of remote documents], if server returns content-type:charset - IT OVERRIDES
         $.response-charset[кодировка удалённых документов], не перебиваеся content-type:charset          $.response-charset[encoding of remote documents], not overridden by content-type:charset
         $.user[пользователь]          $.user[user]
         $.password[пароль]          $.password[password]
     file::load в дополнительные поля записывает      file::load writes additional fields
         ПОЛЕ:значение (имена полей ответа заглавными буквами)          FIELD:value (response field names in uppercase)
         tables << хеш их ПОЛЕ->table с единственным столбцом "value"          tables << a hash of FIELD->table with a single column "value"
             в таких таблицах можно брать повторяющиеся заголовки. например, несколько set-cookies              in such tables you can get repeating headers, e.g. multiple set-cookies
             todo:сделать отдельный cookies              todo: make separate cookies
   
 системные типы ошибок:  system error types:
     parser.compile       ^test[}                компиляция (непарная скобка, ...)      parser.compile       ^test[}                compilation (unmatched bracket, ...)
     parser.runtime       ^if(0).                параметры (больше/меньше, чем нужно, не тех типов, ...)      parser.runtime       ^if(0).                parameters (more/less than needed, wrong types, ...)
     number.zerodivision  ^eval(1/0) ^eval(1%0)      number.zerodivision  ^eval(1/0) ^eval(1%0)
     number.format        ^eval(abc*5)      number.format        ^eval(abc*5)
     file.lock                                                        shared/exclusive lock error      file.lock                                                        shared/exclusive lock error
Line 1391  MAIN Line 1390  MAIN
     http.status          ^file::load[http://ok/there]                host found, connection accepted, status!=200      http.status          ^file::load[http://ok/there]                host found, connection accepted, status!=200
     date.range           ^date::create(10000;1;1)                    date out of valid range      date.range           ^date::create(10000;1;1)                    date out of valid range
   
 если в MAIN определён $SIGPIPE(1) то в случае, если обработка была прервана пользователем, сообщение  if $SIGPIPE(1) is defined in MAIN, then if processing was interrupted by the user, a message
     об этом будет записано в parser3.log      about this is written to parser3.log
   
   if the method description explicitly contains the local variable result (there is also an implicit variable),
       then the code for outputting whitespace literals does not get into the final bytecode
   
 если описание метода содержит локальную переменную result в явном виде (есть и неявная переменная)  $Id$
     то код вывода пробельных литералов не попадает в конечный байт-код  

Removed from v.1.259  
changed lines
  Added in v.1.262


E-mail: