//! TODO: Parsing functionality. Intentionally separate from lexing. const std = @import("std"); const lex = @import("lex.zig"); pub fn parse(allocator: std.mem.Allocator, lexemes: std.ArrayList(lex.Lexeme)) !Ast { _ = allocator; _ = lexemes; return error.Todo; } // TODO: AST // the AST will be a flat array(list?) of nodes, indexed by a handle type. nodes that contain other // nodes will merely contain these handles. pub const Ast = struct { nodes: std.ArrayList(Node), pub const Node = union(enum) { pair: struct { car: Handle, cdr: Handle }, boolean: bool, number: f64, symbol: []const u8, // TODO: interning! string: []const u8, // TODO: interning? inert, ignore, pub const Handle = enum(u32) { _ }; }; };