Closed 0xF6 closed 1 month ago
The recent changes enhance the functionality of the VeinTypeCode
and G_Emitters
classes by introducing new methods for type checking and IL code emission. Improvements include better error handling and type resolution for various expressions, particularly regarding the sizeof
functionality. Testing has also been expanded to ensure robustness in syntax parsing. This shift towards more nuanced type handling and asynchronous execution improves both maintainability and performance within the codebase.
Files | Change Summary |
---|---|
runtime/common/reflection/VeinTypeCode.cs |
Added HasObjectOrClass method to check if an instance represents a class or object. |
runtime/ishtar.generator/generators/emitters.cs |
Introduced EmitSizeOf for calculating type size; refactored EmitTypeOf , EmitNameOf , and EmitTypeIs for better error handling. |
runtime/ishtar.generator/generators/operators.cs |
Modified EmitBinaryExpression for enhanced handling of null types; added IsNullType extension method for checking NullClass types. |
runtime/ishtar.generator/generators/types.cs |
Extended DetermineType method to support SizeOfFunctionExpression , returning VeinTypeCode.TYPE_I4 . |
test/vc_test/Features/EtherealFunctionTest.cs |
Added SizeOfTest method and test case for validating sizeof expression parsing. |
test/vc_test/FullSTDCompilation.cs |
Removed ColorShim.Apply() from Setup ; changed Compile method to use asynchronous execution with RunAsync(...).Result . |
sequenceDiagram
participant User
participant Compiler
participant ILGenerator
participant TypeChecker
User->>Compiler: Request to compile code
Compiler->>TypeChecker: Determine types in code
TypeChecker->>TypeChecker: Check for SizeOfFunctionExpression
TypeChecker-->>Compiler: Return TypeCode
Compiler->>ILGenerator: Emit IL code based on types
ILGenerator->>ILGenerator: Handle null checks and emit size
ILGenerator-->>Compiler: Return emitted IL
Compiler-->>User: Compilation complete
๐ฐ In a world of code so bright,
A rabbit hops with pure delight.
New checks for types and sizes grand,
Emitters dance at our command!
With tests that leap and bounds they take,
A happy tune for code's sweet sake! ๐
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
HasObjectOrClass
andIsNullType
.SizeOfFunctionExpression
in type determination and IL code emission.Bug Fixes
Tests
sizeof
functionality to ensure accurate parsing and validation.Chores