From b2fd18ad1c01e491781a1fa7ee61b4e7d2afab2b Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 11 Feb 2022 02:00:14 -0800 Subject: [PATCH] BRACKET --- src/interpret.re_c.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interpret.re_c.c b/src/interpret.re_c.c index 4b95e2f..b030955 100644 --- a/src/interpret.re_c.c +++ b/src/interpret.re_c.c @@ -36,7 +36,7 @@ static int looks_like_year(const char *const a, int *const year) { /* This defines `enum condition`. */ /*!types:re2c*/ -enum symbol { END, TEXT, BANG, WHITE, MAP }; +enum symbol { END, TEXT, BANG, BRACKET, WHITE, MAP }; /** scanner reads a file and extracts semantic information. Valid to access only while underlying pointers do not change. */ @@ -89,6 +89,8 @@ scan: return s->symbol = TEXT, 1; } @s0 "!" @s1 { s->s0 = s0, s->s1 = s1; return s->symbol = BANG, 1; } + "\\" @s0 "[" @s1 { s->s0 = s0, s->s1 = s1; + return s->symbol = BRACKET, 1; } "![" :=> image "[" :=> command * { return 0; }