# Defines LOG.TEST.LOGFILE
}
LOG.TEST { VERBOSE = "Y" }
- # The subtree name may contain several level names
+ # The subtree name may contain multi-level names
Conditionals
^^^^^^^^^^^^
-Any block of operations may be guarded by a condition. The conditions may be nested and
+Any block of operations may be guarded by a condition. The conditions may be nested and they
consist of expressions containing ``and``, ``or``, ``not`` and variable/string (in)equalities. The strings
may contain substitutions.
LANG = "C"
}
-The curly brackets delimiting the bloc, as well as the brackets in the boolena expression,
+The curly brackets delimiting the block, as well as the parentheses in the boolean expression,
are mandatory. ``else`` is not supported. ``if VAR=="FOO" {...}`` is equivalent to ``if "{VAR}"=="FOO" {...}``.
.. todo:: (OPT) Cleanup of unused undefined variables.
.. todo:: (OPT) Better variable name checking (no name '.'-structural prefix of another)
-.. todo:: (OPT) Implemet "subtree" listing.
+.. todo:: (OPT) Implement "subtree" listing.
"""
import types, itertools, re, bisect
Simple Moe configuration file syntax parser.
Generally, whitespace and comments are alowed everywhere except in variable names and inside expressions,
-``\\n`` ends a ``COMMENT``.
+``\n`` ends a ``COMMENT``.
``FILE``, ``BLOCK``, ``STATEMENT``, ``OPERATION``, ``SUBTREE``, ``CONDITION``, ``FORMULA``, ``AND``, ``OR``
and ``NOT`` ignore any preceding whitespace.
ECHAR = re('([^\{}]|\\|\{|\}|\\n)*')
VARNAME = re('[a-zA-Z0-9-_]+(\.[a-zA-Z0-9-_]+)*')
-.. todo:: should whitespace (incl. '\n') be allowed (almost) everywhere?
+.. todo:: should whitespace (incl. '\\n') be allowed (almost) everywhere?
can comment be anywhere whitespace can?
.. note:: ';' or '\\n' is currently required even after CONDITION and SUBTREE block
.. note:: Formula can contain additional/unnecessary parentheses