logic-ng/LogicNG

What are valid variable names (for parsing)?

rohte opened this issue · 2 comments

rohte commented

I encountered a ParserException due to an invalid character (.) when parsing a formula, which triggered this question. I could not find an answer in the documentation. Through tests I found out that underscores are supported.
Are other special characters supported?

For the standard parser variable names must match the regular expression [A-Za-z0-9_@][A-Za-z0-9_]* (see ANTLR grammar). That means, only underscore is allowed as special character. Symbol @ is allowed only at the start of a variable name. Other than that, no special characters are allowed.

rohte commented

Thank you for the answer.