diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 19:36:23 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-15 19:36:23 -0400 |
| commit | c3615dc92c667899af7a11b2b25201dad5502ee6 (patch) | |
| tree | bdc5db2b7c1cda415ef58eabd6c6dd23237d0ad6 /src/ast.h | |
| parent | 9c1a7c473d96b80561a845bf15ecfd42cd980135 (diff) | |
Deprecate `auto`
Diffstat (limited to 'src/ast.h')
| -rw-r--r-- | src/ast.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -21,12 +21,13 @@ #define TextAST(ast, _str) WrapAST(ast, TextLiteral, .str=GC_strdup(_str)) #define LiteralCode(code, ...) new(ast_t, .tag=InlineCCode, .__data.InlineCCode={.chunks=new(ast_list_t, .ast=FakeAST(TextLiteral, code)), __VA_ARGS__}) #define Match(x, _tag) ((x)->tag == _tag ? &(x)->__data._tag : (errx(1, __FILE__ ":%d This was supposed to be a " # _tag "\n", __LINE__), &(x)->__data._tag)) +#define DeclareMatch(var, x, _tag) __typeof((x)->__data._tag) *var = Match(x, _tag) #define BINARY_OPERANDS(ast) ({ if (!is_binary_operation(ast)) errx(1, __FILE__ ":%d This is not a binary operation!", __LINE__); (ast)->__data.Plus; }) #define REVERSE_LIST(list) do { \ __typeof(list) _prev = NULL; \ __typeof(list) _next = NULL; \ - auto _current = list; \ + __typeof(list) _current = list; \ while (_current != NULL) { \ _next = _current->next; \ _current->next = _prev; \ |
