-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
general error improvements & extensive syntax error checking for vectors
#2. fixed incorrect line/character readout. also color the errors something cool
- Loading branch information
1 parent
d096453
commit 7116ee0
Showing
5 changed files
with
84 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class SyntaxException(Exception): | ||
def __init__(self, expression, message): | ||
super().__init__(f"{message} at line #{expression.current_line_index} character #{expression.current_index} file '{expression.current_file_name}''") | ||
super().__init__(f"{message} at line #{expression.current_line_index} character #{expression.current_index} file '{expression.current_file_name}'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def warn(expression, message): | ||
print(f"\033[93m{message} at line #{expression.current_line_index} character #{expression.current_index} file '{expression.current_file_name}'\033[0m") |