aboutsummaryrefslogtreecommitdiff
path: root/lib/parser.mly
diff options
context:
space:
mode:
authorMarc Coquand <marc@mccd.space>2023-12-26 10:08:23 -0600
committerMarc Coquand <marc@mccd.space>2023-12-26 10:08:23 -0600
commitd96e1839eb800bf26bcc38272072d98af69f5d83 (patch)
tree1570f7f47ba4e39acf4caebfce6eaf4a6575bc97 /lib/parser.mly
parent2bb4215b957d912058d490c16ee64320e3724037 (diff)
downloadfixgen-d96e1839eb800bf26bcc38272072d98af69f5d83.tar.gz
fixgen-d96e1839eb800bf26bcc38272072d98af69f5d83.tar.bz2
fixgen-d96e1839eb800bf26bcc38272072d98af69f5d83.zip
Support const keyword
Diffstat (limited to '')
-rw-r--r--lib/parser.mly7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/parser.mly b/lib/parser.mly
index e9d06bc..6e21480 100644
--- a/lib/parser.mly
+++ b/lib/parser.mly
@@ -14,6 +14,7 @@
%token <int> INT
%token LBRACE
%token RBRACE
+%token <string> STRING
%start <ast_table option > prog
%%
@@ -30,10 +31,16 @@ expr:
row:
| row_title = IDENTIFIER; parent = IDENTIFIER; DOT; parent_id = IDENTIFIER; COMMA; r = row { Foreign (parent,parent_id,row_title, r) }
| row_title = IDENTIFIER; parent = IDENTIFIER; DOT; parent_id = IDENTIFIER; { Foreign (parent,parent_id,row_title, End) }
+
| row_title = IDENTIFIER; UUIDV4; COMMA; r = row { Uuidv4 (row_title, r) }
| row_title = IDENTIFIER; UUIDV4 { Uuidv4 (row_title, End) }
+
| row_title = IDENTIFIER; NAME; COMMA; r = row { Name (row_title, r) }
| row_title = IDENTIFIER; NAME { Name (row_title, End) }
+
+ | row_title = IDENTIFIER; const = STRING; COMMA; r = row { Const (row_title, const, r) }
+ | row_title = IDENTIFIER; const = STRING { Const (row_title, const, End) }
+
| row_title = IDENTIFIER; INTSYMBOL;LBRACE;min = INT;COMMA;max = INT;RBRACE;COMMA; r = row { Int (row_title,min,max,r) }
| row_title = IDENTIFIER; INTSYMBOL;LBRACE;min = INT;COMMA;max = INT;RBRACE; { Int (row_title,min,max,End) }
;