Changes between Version 4 and Version 5 of uste/ParserSyntax


Ignore:
Timestamp:
02/03/13 15:59:53 (10 years ago)
Author:
ph3-der-loewe
Comment:

+ infos about variables.

Legend:

Unmodified
Added
Removed
Modified
  • uste/ParserSyntax

    v4 v5  
    2424 
    2525So software like web servers can detect the file to be a uste template there is the uste magic number. This magic is the special command ''TEMPLATE'' (@@@TEMPLATE@@@). This magic should be used at the begin of each template so it can be detected by such software. This special command is stripped while rendering and will not generate any output. 
     26 
     27== Variables == 
     28uste can handle variables of different types. Those types include integers, strings, floating points, kv (ordered key value pairs (called "hash" in Perl), arrays and more. Some of the commands use variables. Variable names are passed as literals (e.g. `@@@var bla@@@` where ''bla'' is the name of the variable). Variable names can contain the following characters: "a" to "z", "A" to "Z", underscore ("_"), dash ("-") and dollar ("$"). Both dash and dollar are uncommon. The implementation may allow more characters. 
     29 
     30The characters dot (".") and hash ("#") have special meanings. The dot is used to access a member of a kv or array (e.g. `mykv.mymemver`). The hash is used as special escape sequence. If it is followed by a integer it accesses the member with the given number (e.g. `myarray.#0` to access the first element of an array). 
     31 
     32The special (read-only) variable ''###ROOTVAR###'' accesses the current rootvar. This way of accessing can be useful with ''foreach'' to travel all variables. 
    2633 
    2734== Encodings ==