diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-08-29 20:40:35 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-08-29 20:40:35 +0800 |
commit | 7f54baf2668a58f2908f8242b2fbafc65a7f684a (patch) | |
tree | 1b5123dba6112c5bcb3cb9967339ca3c5edf9a5a /projects/hackc/utils.py | |
parent | 51e1667e716ea8c6b20f37cdec1f99eef55eccd6 (diff) |
hackc: exit on invalid token
Diffstat (limited to 'projects/hackc/utils.py')
-rw-r--r-- | projects/hackc/utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/projects/hackc/utils.py b/projects/hackc/utils.py new file mode 100644 index 0000000..d1ea3ca --- /dev/null +++ b/projects/hackc/utils.py @@ -0,0 +1,9 @@ +from sys import stderr + +EXIT_CODE_FILE_ERROR = 1 +EXIT_CODE_INVALID_TOKEN = 2 +EXIT_CODE_SYNTAX_ERROR = 4 + + +def print_err(msg): + print(msg, file=stderr) |