diff options
author | Astatin <[email protected]> | 2024-08-29 16:23:53 +0900 |
---|---|---|
committer | Astatin <astatin@redacted> | 2024-08-29 16:23:53 +0900 |
commit | 17a9053286ac251546dca6cf475d0e9843cf9cc5 (patch) | |
tree | ca6525776a8ecfb62fb96eaa0af5bbd794cd2819 | |
parent | f86601054a141cf189e89528bcd2eda5521b2bb5 (diff) |
Add errors on label already exists
-rwxr-xr-x | gbasm | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -372,7 +372,10 @@ def preprocess(input_file, offset): if ':' in line_without_comment: splitted = line_without_comment.split(':') - labels[splitted[0].strip().upper()] = starting_address + labelName = splitted[0].strip().upper() + if labelName in labels: + raise ValueError("Label \"{}\" is already defined".format(labelName)) + labels[labelName] = starting_address line_without_comment = splitted[1].strip() if line_without_comment != '': |