Skip to content

v0.1.8

Choose a tag to compare

@gmpassos gmpassos released this 15 Apr 02:36
· 481 commits to master since this release
  • ASTStatementForEach:

    • Added new AST statement class representing a for-each loop with a variable name, iterable expression, and loop block.
    • Implements run method 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 ASTStatementForEach in generateASTStatement.
    • Implemented generateASTStatementForEach method to output a for-in loop syntax with variable declaration and loop block.
  • ApolloGenerator:

    • Added abstract method generateASTStatementForEach.
    • Updated generateASTStatement to dispatch to generateASTStatementForEach for ASTStatementForEach.
  • Dart language grammar (dart_grammar.dart):

    • Added parser statementForEach to parse Dart-style for-each loops (for (var x in iterable) { ... }).
    • Added helper parser _forEachVariableDecl to parse optional var or final before variable name.
  • Java language grammar (java11_grammar.dart):

    • Added parser statementForEach to parse Java-style for-each loops (for (Type var : iterable) { ... }).
  • WebAssembly generator (wasm_generator.dart):

    • Added stub generateASTStatementForEach method throwing UnimplementedError.
    • Updated generateASTStatement to dispatch to generateASTStatementForEach.
  • Tests (apollovm_languages_basic_test.dart):

    • Added new Dart test dart_basic_findMax.test.xml demonstrating usage of for-each loop to find max in a list.
    • Test includes source, call, expected output, and generated source code verification.

0.1.7

  • CI:

    • .github/workflows/dart.yml: updated actions/checkout from v3 to v6 and codecov/codecov-action from v3 to v5.
  • apollovm.dart:

    • Exported new utility file src/apollovm_utils.dart.
  • apollovm_runner.dart:

    • ApolloRunner:
      • executeClassMethod: changed to async, added parameter normalization before execution.
      • Added normalizeParameters method 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 List for typed list creation and on Map for case-insensitive key lookup.
  • apollovm_ast_toplevel.dart:

    • ASTFunctionDeclaration:
      • Added normalizeParameters, normalizePositionalParameters, and normalizeNamedParameters methods to convert and normalize parameters according to function declarations.
    • Added extension IterableASTFunctionDeclarationExtension with resolveBestMatchBySignature to select best matching function overload by parameter signature.
  • apollovm_ast_type.dart:

    • ASTType:
      • Added fromType factory to create ASTType from Dart Type.
      • Added toASTValue method to convert native values to ASTValue according to type.
    • Added toASTValue overrides in primitive and collection types (ASTTypeBool, ASTTypeNum, ASTTypeInt, ASTTypeDouble, ASTTypeString, ASTTypeNull, ASTTypeVoid, ASTTypeArray, ASTTypeArray2D, ASTTypeMap, ASTTypeFuture).
    • Added static fromType methods for ASTTypeArray and ASTTypeMap to create instances from Dart generic types.
    • ASTTypeArray and CoreClassList:
      • Added typed singleton instances for common generic types (e.g., List<String>, List<int>, etc.).
      • Added factory constructors and fromType methods to resolve types generically.
    • ASTTypeMap:
      • Added fromType method for common map generic types.
    • ASTTypeFuture:
      • Added toASTValue override to handle conversion from native or future values.
  • apollovm_ast_value.dart:

    • ASTValue.from factory:
      • Added support for ASTTypeBool to create ASTValueBool.
  • apollovm_core_base.dart:

    • ApolloVMCore.getClass:
      • Added optional generics parameter.