aboutsummaryrefslogtreecommitdiff
path: root/src/as_tokenizer.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-03-25 13:07:21 +0800
committerMistivia <i@mistivia.com>2025-03-25 13:07:21 +0800
commitfb7664e087cb1afb64aae2128365f703beb30b57 (patch)
tree6d4e2a4cc695052e489ec9e3fd28538a79a08f4c /src/as_tokenizer.h
parentdc87ff4b0c9f311be7fad652594e3766a4ddb0c6 (diff)
add result style error handling
Diffstat (limited to 'src/as_tokenizer.h')
-rw-r--r--src/as_tokenizer.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/as_tokenizer.h b/src/as_tokenizer.h
index d22ab55..192e381 100644
--- a/src/as_tokenizer.h
+++ b/src/as_tokenizer.h
@@ -35,9 +35,14 @@ struct token_stream {
struct input_stream *s;
};
-struct token* next_token(struct allocator * alct, struct token_stream * ts);
-struct token* peek_token(struct allocator * alct, struct token_stream * ts);
+// result<token*>
+struct result next_token(struct allocator * alct, struct token_stream * ts);
+
+// result<token*>
+struct result peek_token(struct allocator * alct, struct token_stream * ts);
+
void print_token(struct token *t);
+
struct token_stream * new_token_stream(struct allocator * alct, FILE* fp);
#endif // FMV_AS_TOKENIZER_H_