A rudimentary lisp-like language
lisp
1//! TODO: Lexing functionality. Intentionally separate from parsing.
2const std = @import("std");
3
4// Unresolved questions: OOP stateful nonsense or can we just have A Function?
5
6/// TODO: Process a code string into a flat array of tokens.
7pub fn lex(allocator: std.mem.Allocator, code: []const u8) !std.ArrayList(Lexeme) {
8 _ = allocator;
9 _ = code;
10 return error.Todo;
11}
12
13pub const Lexeme = struct {
14 text: []const u8,
15 kind: Kind,
16
17 const Kind = enum {
18 l_paren,
19 r_paren,
20 identifier,
21 number,
22 string,
23 inert,
24 ignore,
25 };
26};