Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant changes to error handling, the lexer, and the parser, as well as updates to the language's type and struct definitions. The most important changes are summarized below:
Error Handling Enhancements:
ERROR_LEVEL
type with different levels of error severity (ERROR_CRITICAL
,ERROR_NORMAL
,WARNING
,INFO
) and integrated it into theWalrusError
struct. Critical errors now stop further execution and display a message indicating compilation has stopped. (errgen/errorPrinter.go
,errgen/errorPrinter_test.go
) [1] [2] [3] [4] [5] [6] [7] [8] [9]Lexer Improvements:
+=
,-=
,*=
,/=
,%=
,^=
) in the lexer. (lexer/tokenizer.go
)ERROR_CRITICAL
level for unexpected characters. (lexer/tokenizer.go
)Parser Enhancements:
ERROR_CRITICAL
level for error reporting, ensuring critical parsing errors halt further processing. (parser/expr.go
,parser/functions.go
) [1] [2] [3] [4] [5] [6]Type and Struct Updates:
Circle
,Rectangle
, andIShape
interface with an implementation forRectangle
. Introduced type aliasing and tested type compatibility and method implementations. (language/types.wal
)StructLiteral
to use a newStructProp
type for properties, allowing for more detailed property definitions. (ast/expr.go
)Miscellaneous Changes:
PrintError
function to improve the formatting of error messages, including color changes and additional information for critical errors. (errgen/errorPrinter.go
) [1] [2] [3]errgen/errorPrinter_test.go
)