Skip to content

Commit

Permalink
Allow '#if defined' in .builtin files
Browse files Browse the repository at this point in the history
All that was necessary was to pass any '#endif' lines through that
didn't match a #ifdef

Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
keith-packard committed Feb 5, 2021
1 parent 7febea1 commit 699616e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snek-builtin.py
Expand Up @@ -131,7 +131,7 @@ def load_builtins(filename):
pass
elif line.startswith("#ifdef"):
current_condition = line.split(" ")[1].strip()
elif line.startswith("#endif"):
elif line.startswith("#endif") and current_condition:
current_condition = None
elif line[0] == "#":
if len(line) > 1 and line[1] != " ":
Expand Down

0 comments on commit 699616e

Please sign in to comment.