Enhance test_lexer.py
with Tests for New Bitwise Operators and Data Types
#67
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.
Description:
This PR enhances the
test_lexer.py
file by adding new test cases to cover the recently added support for bitwise operators and additional data types in the lexer. The changes ensure that the lexer correctly identifies and tokenizes the following elements:Added Test Cases:
Bitwise Operators:
&
(Bitwise AND)|
(Bitwise OR)^
(Bitwise XOR)~
(Bitwise NOT)<<
(Bitwise Shift Left)>>
(Bitwise Shift Right)Assignment Operations for Bitwise Operators:
&=
(Assignment AND)|=
(Assignment OR)^=
(Assignment XOR)%=
(Assignment Modulus)<<=
(Assignment Shift Left)>>=
(Assignment Shift Right)New Data Types:
double
(Double Data Type)unsigned int
(Unsigned Integer Data Type)const
(Type Qualifier)Purpose of the Changes:
These updates ensure that the lexer correctly processes and identifies tokens related to bitwise operations and additional data types. This is critical for expanding the language's capabilities and ensuring robust parsing of shader code.
Testing:
The new test cases have been added to validate the lexer’s functionality with these operators and data types. The tests were executed, and all passed, confirming that the lexer is functioning as expected after the changes.