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
This commit is contained in:
@@ -408,6 +408,23 @@ type PrefixTypeExpr struct {
|
||||
Base TypeExpr
|
||||
}
|
||||
|
||||
// ArrayTypeExpr represents an array type ([N]T).
|
||||
type ArrayTypeExpr struct {
|
||||
Size Expr
|
||||
Elem TypeExpr
|
||||
}
|
||||
|
||||
// SliceTypeExpr represents a slice type ([]T).
|
||||
type SliceTypeExpr struct {
|
||||
Elem TypeExpr
|
||||
}
|
||||
|
||||
// ErrorUnionTypeExpr represents an error union type (E!T).
|
||||
type ErrorUnionTypeExpr struct {
|
||||
ErrSet TypeExpr
|
||||
Type TypeExpr
|
||||
}
|
||||
|
||||
// DocComment represents a doc comment (/// or //! lines).
|
||||
// Newlines in the string automatically add more comments in the output.
|
||||
type DocComment string
|
||||
|
Reference in New Issue
Block a user