You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirmed for at least scene importing, by ZeeRoX
I assume this bug generalizes to most (all?) imports
Even if data is commented out in a .c, it can still be imported by fast64.
I think this is kind of expected behavior from a code perspective since C parsing is entirely regex-based afaik,
but it's confusing from a user perspective
An easy solution may be to strip comments from source before parsing (note: some stuff relies on comments for parsing, like the sm64 "keep block" thing I forgot the name of, maybe other stuff)
The text was updated successfully, but these errors were encountered:
When parsing C, I have taken on this convention to strip all comments and cleanup the lines before parsing:
dat.seek(0) # so it may be read multiple times
InlineReg = "/\*((?!\*/).)*\*/" # filter out inline comments
ldat = dat.readlines()
for l in ldat:
comment = l.rfind("//")
# double slash terminates line basically
if comment:
l = l[:comment]
# remove inline comments from line
l = re.sub(InlineReg, "", l)
# do processing here
This sort of thing can be added easily to a utility function if needed to remove comments. Multi line comments and macros are not caught here either, but those will require a much more complicated parser.
Confirmed for at least scene importing, by ZeeRoX
I assume this bug generalizes to most (all?) imports
Even if data is commented out in a .c, it can still be imported by fast64.
I think this is kind of expected behavior from a code perspective since C parsing is entirely regex-based afaik,
but it's confusing from a user perspective
An easy solution may be to strip comments from source before parsing (note: some stuff relies on comments for parsing, like the sm64 "keep block" thing I forgot the name of, maybe other stuff)
The text was updated successfully, but these errors were encountered: