mirror of
https://github.com/notwa/lips
synced 2024-11-14 18:39:02 -08:00
fix data collection, expect EOLs for all directives
This commit is contained in:
parent
87c210d617
commit
33ea629309
1 changed files with 1 additions and 4 deletions
|
@ -102,16 +102,13 @@ function Collector:directive()
|
||||||
self:optional_comma()
|
self:optional_comma()
|
||||||
add(name, size, self:number())
|
add(name, size, self:number())
|
||||||
end
|
end
|
||||||
self:expect_EOL()
|
|
||||||
end
|
end
|
||||||
elseif name == 'BYTE' or name == 'HALFWORD' or name == 'WORD' then
|
elseif name == 'BYTE' or name == 'HALFWORD' or name == 'WORD' then
|
||||||
self:push_data(self:const().tok, name)
|
self:push_data(self:const().tok, name)
|
||||||
while not self:is_EOL() do
|
while not self:is_EOL() do
|
||||||
self:advance()
|
|
||||||
self:optional_comma()
|
self:optional_comma()
|
||||||
self:push_data(self:const().tok, name)
|
self:push_data(self:const().tok, name)
|
||||||
end
|
end
|
||||||
self:expect_EOL()
|
|
||||||
elseif name == 'INC' or name == 'INCBIN' then
|
elseif name == 'INC' or name == 'INCBIN' then
|
||||||
-- noop, handled by lexer
|
-- noop, handled by lexer
|
||||||
elseif name == 'ASCII' or name == 'ASCIIZ' then
|
elseif name == 'ASCII' or name == 'ASCIIZ' then
|
||||||
|
@ -122,12 +119,12 @@ function Collector:directive()
|
||||||
if name == 'ASCIIZ' then
|
if name == 'ASCIIZ' then
|
||||||
self:push_data(0, 'BYTE')
|
self:push_data(0, 'BYTE')
|
||||||
end
|
end
|
||||||
self:expect_EOL()
|
|
||||||
elseif name == 'FLOAT' then
|
elseif name == 'FLOAT' then
|
||||||
self:error('unimplemented directive', name)
|
self:error('unimplemented directive', name)
|
||||||
else
|
else
|
||||||
self:error('unknown directive', name)
|
self:error('unknown directive', name)
|
||||||
end
|
end
|
||||||
|
self:expect_EOL()
|
||||||
end
|
end
|
||||||
|
|
||||||
function Collector:basic_special()
|
function Collector:basic_special()
|
||||||
|
|
Loading…
Reference in a new issue