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:
@@ -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`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user