Author: van.de.bugger
Description:
Patch for ParserFunctions.
Hi,
Currently ParserFunctions have no notion about variables, which
resulting in lots of typing and lots of braces, for example:
{{ #ifexpr: {{ #var: a }} + {{ #var: a }} > 4 | ... }}
I always wanted #expr and #ifexpr functions recognize variables so I can
write
{{ #ifexpr: a + a > 4 | ... }}
Attached patch implements this integration between ParserFunctions and
Variables.
Changes summary:
- When if a word is a not predefined expression word (like `pi' or
`trunc'), it is checked whether Varaibles extension enabled and whether
such a variable exists. If variable exists, its value used.
- New error message introduced: "Unexpected variable".
- Second parameter added to ExprParser::doExpression, parser — it is
required by Variables (though it is not actually used). For
compatibility with older code, parameter is optional.
- Variables extension is not required, if Variables extension is not
enabled, ParserFunctions does not recognize variables but does not issue
errors.
I have access to SVN. If the patch is generally ok, I can commit it.
Thanks,
Van.
Version: unspecified
Severity: enhancement
Attached: