Skip to content

transpiler: complete transpilation for all Statement/Expr variants and builtin functions #17

Description

@Prestgg1

Goal

Make the transpiler crate fully functional so it can transpile all AzLang programs to valid Zig code.

Current State

The transpiler has 8 compilation errors and massive gaps:

Compilation Errors to Fix

  1. Program type not found (needs to import from validator crate)
  2. Call missing returned_type field
  3. BuiltInCall missing return_type field
  4. BinaryOp missing return_type field
  5. Symbol has is_mutable instead of is_pointer
  6. Same field mismatches in helper.rs

Missing Statement Transpilation (6 variants)

  • EnumDecl - enum declarations
  • FunctionDef - function definitions
  • StructDef - struct definitions
  • UnionType - union type definitions
  • Match - pattern matching
  • Loop - for-each loops

Missing Expr Transpilation (16 variants)

DynamicString, Void, Return, Time, Char, Comment, UnaryOp, Index, TemplateString, StructInit, Break, Continue
Also broken: VariableRef (is_pointer), BinaryOp (return_type), Call (returned_type)

Missing Builtin Function Transpilation (21 of 22)

Only Print is implemented. Missing: Input, Len, Number, Sum, Range, Trim, Sqrt, Timer, Max, Mod, Min, Round, Floor, Ceil, Zig, StrUpper, StrReverse, StrLower, Allocator, ConvertString

Dead Code Cleanup

Many files are commented out or contain stubs that need to be either restored or removed:
binary_op.rs, function_call.rs, strategy.rs, variable_ref.rs, declaration/variable_decl.rs, definition/*, builtin/* (except print), codegen/*, zigbuiltin_functions.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions