diff --git a/CHANGELOG.md b/CHANGELOG.md index 1765a13..f6e99a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Use of `SWI` and `RTI` operations now result in parse-time errors instead of run-time warnings. - HERA files may no longer contain non-ASCII bytes. - Type errors are detected even in files with parse errors. +- The `--no-debug` flag has been renamed to `--no-debug-ops`. ### Fixed - The debugger will no longer crash when printing the value of a label on the last line of a program. diff --git a/hera/checker.py b/hera/checker.py index 36b2c8f..1d017c7 100644 --- a/hera/checker.py +++ b/hera/checker.py @@ -84,9 +84,9 @@ def typecheck( if not settings.allow_interrupts and isinstance(op, (RTI, SWI)): messages.err("hera-py does not support {}".format(op.name), loc=op.loc) - if settings.no_debug and isinstance(op, DebuggingOperation): + if settings.no_debug_ops and isinstance(op, DebuggingOperation): messages.err( - "debugging instructions disallowed with --no-debug flag", loc=op.loc + "debugging instructions disallowed with --no-debug-ops flag", loc=op.loc ) # Add constants to the symbol table as they are encountered, so that a given diff --git a/hera/data.py b/hera/data.py index 08511a2..f4400c4 100644 --- a/hera/data.py +++ b/hera/data.py @@ -23,7 +23,7 @@ def __init__( color=True, data_start=DEFAULT_DATA_START, debug=False, - no_debug=False, + no_debug_ops=False, volume=VOLUME_NORMAL, warn_octal_on=True, warn_return_on=True @@ -32,7 +32,7 @@ def __init__( self.color = color self.data_start = data_start self.debug = debug - self.no_debug = no_debug + self.no_debug_ops = no_debug_ops self.warn_octal_on = warn_octal_on self.warn_return_on = warn_return_on self.volume = volume diff --git a/hera/main.py b/hera/main.py index 6681461..d771264 100644 --- a/hera/main.py +++ b/hera/main.py @@ -34,7 +34,7 @@ def main(argv=None) -> Optional[VirtualMachine]: # Arbitrary value copied over from HERA-C. settings.data_start = 0xC167 - settings.no_debug = arguments["--no-debug"] + settings.no_debug_ops = arguments["--no-debug-ops"] settings.warn_return_on = not arguments["--warn-return-off"] settings.warn_octal_on = not arguments["--warn-octal-off"] @@ -175,7 +175,7 @@ def short_to_long(arg): "--big-stack", "--help", "--no-color", - "--no-debug", + "--no-debug-ops", "--quiet", "--verbose", "--version", @@ -198,7 +198,7 @@ def short_to_long(arg): -v, --version Show the version and exit. --no-color Do not print colored output. - --no-debug Disallow debugging instructions. + --no-debug-ops Disallow debugging instructions. -q --quiet Set output level to quiet. --verbose Set output level to verbose. --warn-octal-off Do not print warnings for zero-prefixed integer literals. diff --git a/test/test_cmd.py b/test/test_cmd.py index 0685438..b8097b0 100644 --- a/test/test_cmd.py +++ b/test/test_cmd.py @@ -190,14 +190,14 @@ def test_main_with_no_debug_flag(capsys): with pytest.raises(SystemExit): program = "print_reg(R1)" with patch("sys.stdin", StringIO(program)): - main(["--no-debug", "-"]) + main(["--no-debug-ops", "-"]) captured = capsys.readouterr() assert ( captured.err == """\ -Error: debugging instructions disallowed with --no-debug flag, line 1 col 1 of +Error: debugging instructions disallowed with --no-debug-ops flag, line 1 col 1 of print_reg(R1) ^