Simplify parser.

Use 'if let' instead of 'match' where it makes sense.

Use EBNF notation for the grammar rules. This simplifies repetition a lot.
This commit is contained in:
Jakob Stoklund Olesen
2016-04-28 08:06:30 -07:00
parent f1a4b28d3f
commit 8d0311b642
2 changed files with 41 additions and 56 deletions

View File

@@ -413,11 +413,9 @@ calling convention:
.. productionlist::
signature : "(" [arglist] ")" ["->" retlist] [call_conv]
arglist : arg
: arglist "," arg
arglist : arg { "," arg }
retlist : arglist
arg : type
: arg flag
arg : type { flag }
flag : "uext" | "sext" | "inreg"
callconv : `string`