From 51820234a845e89c049273b2149c73d4eceeddb0 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 1 May 2016 03:56:56 -0700 Subject: [PATCH] allow VARSYMs in directives --- lips/Collector.lua | 4 ++-- lips/Preproc.lua | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lips/Collector.lua b/lips/Collector.lua index 2fb21a7..b258186 100644 --- a/lips/Collector.lua +++ b/lips/Collector.lua @@ -108,12 +108,12 @@ function Collector:directive() if self:is_EOL() and name == 'ALIGN' then add(name) else - local size = self:number() + local size = self:const(nil, 'no label') if self:is_EOL() then add(name, size) else self:optional_comma() - add(name, size, self:number()) + add(name, size, self:const(nil, 'no label')) end end elseif name == 'BYTE' or name == 'HALFWORD' or name == 'WORD' then diff --git a/lips/Preproc.lua b/lips/Preproc.lua index ab68da2..7f05eee 100644 --- a/lips/Preproc.lua +++ b/lips/Preproc.lua @@ -146,6 +146,9 @@ function Preproc:process(statements) end insert(new_statements, s) else + for j, t in ipairs(s) do + self:lookup(t) + end insert(new_statements, s) end else