Home | Trees | Indices | Help |
---|
|
object --+ | Parser
Parse a template into a parse-tree.
Includes a syntax-check, an optional expression-check and verbose error-messages.
See documentation for a description of the parse-tree.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
_comment_start = "#!"
|
|||
_comment_end = "!#"
|
|||
_sub_start = "$!"
|
|||
_sub_end = "!$"
|
|||
_subesc_start = "@!"
|
|||
_subesc_end = "!@"
|
|||
_block_start = "<!--("
|
|||
_block_end = ")-->"
|
|||
_strComment = r"""%s(?P<content>.*?)(?P<end>%s|\n|$)""" %(re.e
|
|||
_reComment = re.compile(_strComment, re.M)
|
|||
_strSubstitution = r
|
|||
_reSubstitution = re.compile(_strSubstitution, re.X | re.M)
|
|||
_s = re.escape(_block_start)
|
|||
_e = re.escape(_block_end)
|
|||
_strBlock = r
|
|||
_reBlock = re.compile(_strBlock, re.X | re.M)
|
|||
_strForParam = r"""^(?P<names>\w+(?:\s*,\s*\w+)*)\s+in\s+(?P<i
|
|||
_reForParam = re.compile(_strForParam)
|
|||
_reMacroParam = re.compile(r"""^\w+$""")
|
|
|||
Inherited from |
|
Init the parser. :Parameters:
:Exceptions:
|
Parse a template. :Parameters:
:Returns: the resulting parse-tree :Exceptions:
|
Parse substitutions, and append them to the parse-tree. Additionally, remove comments. |
Recursive part of `parse()`. :Parameters:
|
|
_strComment
|
_strSubstitution
|
_strBlock
|
_strForParam
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Mar 14 15:44:56 2013 | http://epydoc.sourceforge.net |