|
22 | 22 | from src.api import config, global_, utils |
23 | 23 | from src.ply import yacc |
24 | 24 | from src.zxbpp import zxbasmpplex, zxbpplex |
| 25 | +from src.zxbpp.base_pplex import STDIN |
25 | 26 | from src.zxbpp.prepro import ID, Arg, ArgList, DefinesTable, MacroCall, output |
26 | 27 | from src.zxbpp.prepro.builtinmacro import BuiltinMacro |
27 | 28 | from src.zxbpp.prepro.exceptions import PreprocError |
@@ -124,7 +125,7 @@ def init(): |
124 | 125 | global IFDEFS |
125 | 126 |
|
126 | 127 | config.OPTIONS(config.Action.ADD_IF_NOT_DEFINED, name="debug_zxbpp", type=bool, default=False) |
127 | | - global_.FILENAME = "(stdin)" |
| 128 | + global_.FILENAME = STDIN |
128 | 129 | OUTPUT = "" |
129 | 130 | INCLUDED = {} |
130 | 131 | CURRENT_DIR = "" |
@@ -979,9 +980,10 @@ def entry_point(args=None): |
979 | 980 | config.OPTIONS.stderr_filename = options.stderr |
980 | 981 | config.OPTIONS.stderr = utils.open_file(config.OPTIONS.stderr_filename, "wt", "utf-8") |
981 | 982 |
|
982 | | - _, ext = os.path.splitext(options.input_file) |
983 | | - if ext.lower() == "asm": |
984 | | - setMode(PreprocMode.ASM) |
| 983 | + if options.input_file: |
| 984 | + _, ext = os.path.splitext(options.input_file) |
| 985 | + if ext.lower() == "asm": |
| 986 | + setMode(PreprocMode.ASM) |
985 | 987 |
|
986 | 988 | result = main([options.input_file] if options.input_file else []) |
987 | 989 | if not global_.has_errors: # ok? |
|
0 commit comments