allow forward slash in strings for if statements

This commit is contained in:
Axel Kohlmeyer
2020-10-06 18:44:26 -04:00
parent 15f9987c32
commit f0f933a711
2 changed files with 4 additions and 4 deletions

View File

@ -140,12 +140,12 @@ clarity, you must enclose the entire expression in quotes.
An expression is built out of numbers (which start with a digit or An expression is built out of numbers (which start with a digit or
period or minus sign) or strings (which start with a letter and can period or minus sign) or strings (which start with a letter and can
contain alphanumeric characters or underscores): contain alphanumeric characters, underscores, or forward slashes):
.. parsed-literal:: .. parsed-literal::
0.2, 100, 1.0e20, -15.4, etc 0.2, 100, 1.0e20, -15.4, ...
InP, myString, a123, ab_23_cd, etc InP, myString, a123, ab_23_cd, lj/cut, ...
and Boolean operators: and Boolean operators:

View File

@ -4902,7 +4902,7 @@ double Variable::evaluate_boolean(char *str)
// set I to end of string // set I to end of string
int istart = i++; int istart = i++;
while (isalnum(str[i]) || str[i] == '_') i++; while (isalnum(str[i]) || (str[i] == '_') || (str[i] == '/')) i++;
int n = i - istart + 1; int n = i - istart + 1;
argstack[nargstack].str = new char[n]; argstack[nargstack].str = new char[n];