diff options
author | yenatch <yenatch@gmail.com> | 2013-06-25 21:24:09 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-06-25 21:24:09 -0400 |
commit | 8d2df72cb8d09d7cf4ea839199ad8a50230ea6b2 (patch) | |
tree | 13bfcae101b83f365b4a31da90669f2a15dbe4bd /preprocessor.py | |
parent | fdf1070dff66e5fffda76286f2dbc823fcdc2789 (diff) |
pre: restore separate_comment's behavior
Diffstat (limited to 'preprocessor.py')
-rw-r--r-- | preprocessor.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/preprocessor.py b/preprocessor.py index bf9220a83..468ae41a5 100644 --- a/preprocessor.py +++ b/preprocessor.py @@ -317,7 +317,7 @@ def separate_comment(l): break if l[i] == "\"": in_quotes = not in_quotes - return i + return l[:i], l[i:] or None def quote_translator(asm): """ @@ -574,8 +574,8 @@ def macro_translator(macro, token, line): def read_line(l): """Preprocesses a given line of asm.""" - # strip comments - asm, comment = l[:separate_comment(l)], l[separate_comment(l):] + # strip comments from asm + asm, comment = separate_comment(l) # export all labels if ':' in asm[:asm.find('"')]: @@ -602,7 +602,8 @@ def read_line(l): macro_translator(macro, token, asm) else: sys.stdout.write(asm) - sys.stdout.write(comment) + + if comment: sys.stdout.write(comment) def preprocess(lines=None): """Main entry point for the preprocessor.""" |