From 5afb7439777736da7219eb4b4582f9db66b38033 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 10 Apr 2016 03:39:50 -0700 Subject: [PATCH] fix unary preprocessing --- lips/Preproc.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lips/Preproc.lua b/lips/Preproc.lua index 568426a..37db636 100644 --- a/lips/Preproc.lua +++ b/lips/Preproc.lua @@ -24,13 +24,14 @@ function Preproc:process(tokens) local t = self:advance() local sign = 1 if t.tt == 'UNARY' then + sign = t.tok local peek = self.tokens[self.i + 1] if peek.tt == 'UNARY' then self:error('unary operators cannot be chained') elseif peek.tt == 'EOL' or peek.tt == 'SEP' then - t.tt = 'RELLABEL' + t.tt = 'RELLABELSYM' elseif peek.tt == 'DEFSYM' then - sign = t.tok + t = self:advance() else self:error('expected a symbolic constant after unary operator') end