From f0f933a7115598a4bfbea912da8d148e558df0e1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 6 Oct 2020 18:44:26 -0400 Subject: [PATCH] allow forward slash in strings for if statements --- doc/src/if.rst | 6 +++--- src/variable.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/src/if.rst b/doc/src/if.rst index 3f39edceb3..36d78da0d3 100644 --- a/doc/src/if.rst +++ b/doc/src/if.rst @@ -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 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:: - 0.2, 100, 1.0e20, -15.4, etc - InP, myString, a123, ab_23_cd, etc + 0.2, 100, 1.0e20, -15.4, ... + InP, myString, a123, ab_23_cd, lj/cut, ... and Boolean operators: diff --git a/src/variable.cpp b/src/variable.cpp index 6931fd9122..54c55fe11f 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -4902,7 +4902,7 @@ double Variable::evaluate_boolean(char *str) // set I to end of string int istart = i++; - while (isalnum(str[i]) || str[i] == '_') i++; + while (isalnum(str[i]) || (str[i] == '_') || (str[i] == '/')) i++; int n = i - istart + 1; argstack[nargstack].str = new char[n];