Repository navigation
v0.1.8
-
ASTStatementForEach:- Added new AST statement class representing a for-each loop with a variable name, iterable expression, and loop block.
- Implements
runmethod to iterate over an iterable AST value, declaring the loop variable in a nested context and running the loop block. - Resolves type as
void.
-
ApolloCodeGenerator:- Added support for generating code for
ASTStatementForEachingenerateASTStatement. - Implemented
generateASTStatementForEachmethod to output a for-in loop syntax with variable declaration and loop block.
- Added support for generating code for
-
ApolloGenerator:- Added abstract method
generateASTStatementForEach. - Updated
generateASTStatementto dispatch togenerateASTStatementForEachforASTStatementForEach.
- Added abstract method
-
Dart language grammar (
dart_grammar.dart):- Added parser
statementForEachto parse Dart-style for-each loops (for (var x in iterable) { ... }). - Added helper parser
_forEachVariableDeclto parse optionalvarorfinalbefore variable name.
- Added parser
-
Java language grammar (
java11_grammar.dart):- Added parser
statementForEachto parse Java-style for-each loops (for (Type var : iterable) { ... }).
- Added parser
-
WebAssembly generator (
wasm_generator.dart):- Added stub
generateASTStatementForEachmethod throwingUnimplementedError. - Updated
generateASTStatementto dispatch togenerateASTStatementForEach.
- Added stub
-
Tests (
apollovm_languages_basic_test.dart):- Added new Dart test
dart_basic_findMax.test.xmldemonstrating usage of for-each loop to find max in a list. - Test includes source, call, expected output, and generated source code verification.
- Added new Dart test
0.1.7
-
CI:
.github/workflows/dart.yml: updatedactions/checkoutfrom v3 to v6 andcodecov/codecov-actionfrom v3 to v5.
-
apollovm.dart:- Exported new utility file
src/apollovm_utils.dart.
- Exported new utility file
-
apollovm_runner.dart:ApolloRunner:executeClassMethod: changed to async, added parameter normalization before execution.- Added
normalizeParametersmethod to normalize positional and named parameters against AST function declarations. executeFunction: added parameter normalization for top-level functions.- Improved parameter handling for function execution.
-
apollovm_utils.dart(new):- Added utilities for generic typed list conversion and case-insensitive map key lookup.
- Extensions on
Listfor typed list creation and onMapfor case-insensitive key lookup.
-
apollovm_ast_toplevel.dart:ASTFunctionDeclaration:- Added
normalizeParameters,normalizePositionalParameters, andnormalizeNamedParametersmethods to convert and normalize parameters according to function declarations.
- Added
- Added extension
IterableASTFunctionDeclarationExtensionwithresolveBestMatchBySignatureto select best matching function overload by parameter signature.
-
apollovm_ast_type.dart:ASTType:- Added
fromTypefactory to create ASTType from DartType. - Added
toASTValuemethod to convert native values to ASTValue according to type.
- Added
- Added
toASTValueoverrides in primitive and collection types (ASTTypeBool,ASTTypeNum,ASTTypeInt,ASTTypeDouble,ASTTypeString,ASTTypeNull,ASTTypeVoid,ASTTypeArray,ASTTypeArray2D,ASTTypeMap,ASTTypeFuture). - Added static
fromTypemethods forASTTypeArrayandASTTypeMapto create instances from Dart generic types. ASTTypeArrayandCoreClassList:- Added typed singleton instances for common generic types (e.g.,
List<String>,List<int>, etc.). - Added factory constructors and
fromTypemethods to resolve types generically.
- Added typed singleton instances for common generic types (e.g.,
ASTTypeMap:- Added
fromTypemethod for common map generic types.
- Added
ASTTypeFuture:- Added
toASTValueoverride to handle conversion from native or future values.
- Added
-
apollovm_ast_value.dart:ASTValue.fromfactory:- Added support for
ASTTypeBoolto createASTValueBool.
- Added support for
-
apollovm_core_base.dart:ApolloVMCore.getClass:- Added optional
genericsparameter.
- Added optional