Skip to content

Commit 750caf4

Browse files
authored
Merge branch 'main' into docs
2 parents cc060ae + bd22c73 commit 750caf4

36 files changed

Lines changed: 972 additions & 16851 deletions

src/zxbpp/base_pplex.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
EOL = "\n"
2525

2626
# Names for std input/output
27-
STDOUT = "<stdout>"
28-
STDIN = "<stdin>"
29-
STDERR = "<stderr>"
27+
STDERR = "(stderr)"
28+
STDIN = "(stdin)"
29+
STDOUT = "(stdout)"
3030

3131

3232
@unique

src/zxbpp/zxbpp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from src.api import config, global_, utils
2323
from src.ply import yacc
2424
from src.zxbpp import zxbasmpplex, zxbpplex
25+
from src.zxbpp.base_pplex import STDIN
2526
from src.zxbpp.prepro import ID, Arg, ArgList, DefinesTable, MacroCall, output
2627
from src.zxbpp.prepro.builtinmacro import BuiltinMacro
2728
from src.zxbpp.prepro.exceptions import PreprocError
@@ -124,7 +125,7 @@ def init():
124125
global IFDEFS
125126

126127
config.OPTIONS(config.Action.ADD_IF_NOT_DEFINED, name="debug_zxbpp", type=bool, default=False)
127-
global_.FILENAME = "(stdin)"
128+
global_.FILENAME = STDIN
128129
OUTPUT = ""
129130
INCLUDED = {}
130131
CURRENT_DIR = ""
@@ -979,9 +980,10 @@ def entry_point(args=None):
979980
config.OPTIONS.stderr_filename = options.stderr
980981
config.OPTIONS.stderr = utils.open_file(config.OPTIONS.stderr_filename, "wt", "utf-8")
981982

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)
985987

986988
result = main([options.input_file] if options.input_file else [])
987989
if not global_.has_errors: # ok?

src/zxbpp/zxbpplex.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@
1717
from src.zxbpp.base_pplex import BaseLexer, ReservedDirectives
1818
from src.zxbpp.prepro.definestable import DefinesTable
1919

20-
EOL = "\n"
21-
22-
# Names for std input/output
23-
STDOUT = "<stdout>"
24-
STDIN = "<stdin>"
25-
STDERR = "<stderr>"
26-
2720
states = (
2821
("prepro", "exclusive"),
2922
("line", "exclusive"),

0 commit comments

Comments
 (0)