12 Commits

Author SHA1 Message Date
bea04d6810 Add comprehensive test system for Go-to-Zig compiler
- Implement end-to-end test runner for compilation and behavior tests
- Add test cases for basic print functionality
- Refactor translator to use proper AST generation
- Remove redundant programs directory in favor of tests
2025-06-05 22:36:38 -05:00
d5f346cf8b Add comprehensive test suite for Zig AST
- Add TestAllExpressionTypes covering all expression nodes
- Add TestAllStatementTypes covering all statement nodes
- Add TestAllTypeExpressions covering all type expressions
- Add TestControlFlowPatterns demonstrating complex control flow
- Fix formatter for field initializers, type spacing, and labels
- Fix handling of orelse blocks, switch payloads, and errdefer
- Remove duplicate test functions from previous edits
- Tests serve as documentation/examples for AST construction
2025-06-05 22:00:41 -05:00
2af696078d Improve Zig AST developer experience
- Convert string-based type discrimination to type-safe enums
  - ContainerKind (struct, enum, union, opaque)
  - LiteralKind (int, float, string, char)
  - LoopKind (for, while)
- Remove duplicate AST nodes (consolidated init lists, removed unused types)
- Add comprehensive helper functions for all AST constructions
- Implement formatters for all AST nodes (expressions, statements, types)
- Add typed literal constructors: IntLit, FloatLit, StringLit, CharLit
- Improve documentation and add deprecation notices

This makes the AST more intuitive and type-safe for developers.
2025-06-05 21:10:50 -05:00
258b3c8e9b Add comprehensive Zig syntax test coverage
- Add support for error sets and error union types
- Implement for loops with index and payload syntax
- Add defer, break, continue, and switch statements
- Support unary expressions and array indexing
- Add unreachable expression and test declarations
- Extend AST with new type expressions (array, error union)
- Update formatter to handle all new syntax elements
- Fix formatting for switch prongs, payloads, and blocks
2025-06-05 20:44:49 -05:00
50b38254ab Added 2 tests and asthelpers.go 2025-05-29 16:27:36 -05:00
44f3cfca5c Generate hello world Zig code 2025-05-24 16:38:46 -05:00
d002309e93 Refactored code generator, tracks indentation, no error checking 2025-05-24 15:46:45 -05:00
dba4617520 Add 'make test' command 2025-05-24 15:26:30 -05:00
d94403d126 Nearly complete Zig AST 2025-05-24 15:17:04 -05:00
0bf8c3ef6b Starting Zig code generator with one test 2025-05-21 23:00:35 -05:00
bdf7ea85d3 Hello, world! 2025-05-20 19:20:16 -05:00
ff502854ed Initial commit 2025-05-20 23:13:27 +00:00