jasy.template package¶
Submodules¶
jasy.template.Compiler module¶
jasy.template.Parser module¶
-
jasy.template.Parser.
tokenize
(text, nostrip=False)[source]¶ Tokenizer for template @text {String}. Returns an array of tokens where tags are returned as an object with the keys tag and name while normal strings are kept as strings.
Optionally you can keep white spaces (line breaks, leading, trailing, etc.) by enabling @nostrip {Boolean?false}.
-
jasy.template.Parser.
parse
(text, nostrip=False)[source]¶ Returns the token tree of the given template @text {String}.
A token holds the following information:
- tag: tag of the token
- name: name of the token
- nodes: children of the node
Optionally you can keep white spaces (line breaks, leading, trailing, etc.) by enabling @nostrip {Boolean?false}.