aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-20 00:21:42 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-11-20 01:52:39 +0100
commit1cec19df78318aee1330b611c6de58d128c205c4 (patch)
tree980406001d87083fdf0ed4c1dad0334de8ea6e59
parent84ab1698e63170a94cfa1c5d99b7316cf3c2b584 (diff)
downloadsciteco-1cec19df78318aee1330b611c6de58d128c205c4.tar.gz
fixed interpretation of the Q-Register specification ".."
* From what the documentation says, a dot may only be used once to introduce a local Q-Register specification. The parser was accepting arbitrarily many dots though. * Now, ".." will refer to the local register ".".
-rw-r--r--src/qregisters.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qregisters.cpp b/src/qregisters.cpp
index 23d7fc4..f6c89a8 100644
--- a/src/qregisters.cpp
+++ b/src/qregisters.cpp
@@ -990,9 +990,6 @@ QRegSpecMachine::input(gchar chr, QRegister *&result)
MICROSTATE_START;
switch (chr) {
- case '.':
- undo.push_var(is_local) = true;
- break;
case '#':
set(&&StateFirstChar);
break;
@@ -1000,6 +997,12 @@ MICROSTATE_START;
set(&&StateString);
undo.push_var(nesting)++;
break;
+ case '.':
+ if (!is_local) {
+ undo.push_var(is_local) = true;
+ break;
+ }
+ /* fall through */
default:
undo.push_str(name) = String::chrdup(String::toupper(chr));
goto done;