From c356b7a1848449b31278659e8b0df503881ed008 Mon Sep 17 00:00:00 2001 From: Michael Abed Date: Tue, 31 Jan 2012 09:41:01 -0500 Subject: correctly handle blank lines --- asmblr.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'asmblr.py') diff --git a/asmblr.py b/asmblr.py index ba2c89c..93dd097 100755 --- a/asmblr.py +++ b/asmblr.py @@ -4,7 +4,7 @@ import sys def tokenize(i): - if i[0] == ';': return None + if i[0] == ';' or i.strip() == '': return None x = i.strip().split(' ') if len(x) == 3 and ',' in x[1]: x[1] = x[1].split(',')[0] @@ -104,6 +104,7 @@ for i in prgm: tokens = filter(None, tokens) + addresses = genaddresses(tokens) code = gencode(tokens, addresses, opcodes) -- cgit v1.2.3