You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
pre: restore separate_comment's behavior
This commit is contained in:
@@ -317,7 +317,7 @@ def separate_comment(l):
|
|||||||
break
|
break
|
||||||
if l[i] == "\"":
|
if l[i] == "\"":
|
||||||
in_quotes = not in_quotes
|
in_quotes = not in_quotes
|
||||||
return i
|
return l[:i], l[i:] or None
|
||||||
|
|
||||||
def quote_translator(asm):
|
def quote_translator(asm):
|
||||||
"""
|
"""
|
||||||
@@ -574,8 +574,8 @@ def macro_translator(macro, token, line):
|
|||||||
def read_line(l):
|
def read_line(l):
|
||||||
"""Preprocesses a given line of asm."""
|
"""Preprocesses a given line of asm."""
|
||||||
|
|
||||||
# strip comments
|
# strip comments from asm
|
||||||
asm, comment = l[:separate_comment(l)], l[separate_comment(l):]
|
asm, comment = separate_comment(l)
|
||||||
|
|
||||||
# export all labels
|
# export all labels
|
||||||
if ':' in asm[:asm.find('"')]:
|
if ':' in asm[:asm.find('"')]:
|
||||||
@@ -602,7 +602,8 @@ def read_line(l):
|
|||||||
macro_translator(macro, token, asm)
|
macro_translator(macro, token, asm)
|
||||||
else:
|
else:
|
||||||
sys.stdout.write(asm)
|
sys.stdout.write(asm)
|
||||||
sys.stdout.write(comment)
|
|
||||||
|
if comment: sys.stdout.write(comment)
|
||||||
|
|
||||||
def preprocess(lines=None):
|
def preprocess(lines=None):
|
||||||
"""Main entry point for the preprocessor."""
|
"""Main entry point for the preprocessor."""
|
||||||
|
Reference in New Issue
Block a user