From 63ddf558dfc5d0de0f9b9d8a2c7f27f11e7fd916 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 27 Nov 2016 21:37:57 -0800 Subject: [PATCH] parse variable definitions as expressions --- lips/Lexer.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lips/Lexer.lua b/lips/Lexer.lua index 22cd5cb..ed01e27 100644 --- a/lips/Lexer.lua +++ b/lips/Lexer.lua @@ -406,6 +406,13 @@ function Lexer:lex(_yield) end self:nextc() yield('VAR', buff) + self:read_spaces() + if self.chr == '@' then + -- old syntax; nothing to do here + else + buff = self:read_chars('[^\n]') + yield('EXPR', buff) + end elseif self.chr == ']' then self:error('unmatched closing bracket') elseif self.chr == '(' then