From d028cc9c04cf46256166434bdea68d5f5c6d310f Mon Sep 17 00:00:00 2001 From: kartofen Date: Tue, 8 Jul 2025 18:25:29 +0300 Subject: simple calculator example --- parts/table.h | 2 +- parts/toklist.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'parts') diff --git a/parts/table.h b/parts/table.h index 486466f..fc63488 100644 --- a/parts/table.h +++ b/parts/table.h @@ -12,7 +12,7 @@ extern struct action { extern size_t table_states; -extern int (*table_fill)(); +extern int (*table_fill)(); // non-zero on fail extern void (*table_free)(); void table_print(); diff --git a/parts/toklist.h b/parts/toklist.h index f32cd25..760846f 100644 --- a/parts/toklist.h +++ b/parts/toklist.h @@ -5,10 +5,10 @@ struct token; -// /*extern*/ struct token *toklist_eat(); -// /*extern*/ struct token *toklist_peek(); +symbol token_sym(struct token *t); // UB for NULL +int token_val(struct token *t); // UB for NULL -symbol toklist_eat(); -symbol toklist_peek(); +struct token *toklist_eat(); // always non-NULL +struct token *toklist_peek(); // always non-NULL #endif -- cgit v1.2.3