summaryrefslogtreecommitdiff
path: root/lib/lace/lex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lace/lex.lua')
-rw-r--r--lib/lace/lex.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/lace/lex.lua b/lib/lace/lex.lua
index d7d18da..3bd9ec2 100644
--- a/lib/lace/lex.lua
+++ b/lib/lace/lex.lua
@@ -46,6 +46,10 @@ local function _lex_one_line(line, terminator)
else
if c == terminator and quoting == false then
-- Reached the terminator, break out
+ -- The terminator is not actually part of the last word in the line
+ -- so we push back that character,
+ -- since it's the only case we actually need to put any back.
+ cpos = cpos - 1
break
elseif c == "'" and quoting == false then
-- Start single quotes