From 1cec19df78318aee1330b611c6de58d128c205c4 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 20 Nov 2016 00:21:42 +0100 Subject: 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 ".". --- src/qregisters.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3