From 33ea6293091b57e4ca0f21d7aa6c726bfa016071 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 23 Apr 2016 02:10:38 -0700 Subject: [PATCH] fix data collection, expect EOLs for all directives --- lips/Collector.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lips/Collector.lua b/lips/Collector.lua index 1e5208e..a41b535 100644 --- a/lips/Collector.lua +++ b/lips/Collector.lua @@ -102,16 +102,13 @@ function Collector:directive() self:optional_comma() add(name, size, self:number()) end - self:expect_EOL() end elseif name == 'BYTE' or name == 'HALFWORD' or name == 'WORD' then self:push_data(self:const().tok, name) while not self:is_EOL() do - self:advance() self:optional_comma() self:push_data(self:const().tok, name) end - self:expect_EOL() elseif name == 'INC' or name == 'INCBIN' then -- noop, handled by lexer elseif name == 'ASCII' or name == 'ASCIIZ' then @@ -122,12 +119,12 @@ function Collector:directive() if name == 'ASCIIZ' then self:push_data(0, 'BYTE') end - self:expect_EOL() elseif name == 'FLOAT' then self:error('unimplemented directive', name) else self:error('unknown directive', name) end + self:expect_EOL() end function Collector:basic_special()