mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-16 11:48:47 +00:00
Pattern-matching parsing
This commit is contained in:
parent
3f40a66f43
commit
de760a2b09
3 changed files with 50 additions and 5 deletions
|
|
@ -8,7 +8,14 @@ let parse infile =
|
|||
inherit Util.Lexers.decimal s
|
||||
inherit Util.Lexers.string s
|
||||
inherit Util.Lexers.char s
|
||||
inherit Util.Lexers.ident ["skip"; "if"; "then"; "else"; "elif"; "fi"; "while"; "do"; "od"; "repeat"; "until"; "for"; "fun"; "local"; "return"; "length"] s
|
||||
inherit Util.Lexers.ident ["skip";
|
||||
"if"; "then"; "else"; "elif"; "fi";
|
||||
"while"; "do"; "od";
|
||||
"repeat"; "until";
|
||||
"for";
|
||||
"fun"; "local"; "return";
|
||||
"length";
|
||||
"case"; "of"; "esac"; "when"] s
|
||||
inherit Util.Lexers.skip [
|
||||
Matcher.Skip.whitespaces " \t\n";
|
||||
Matcher.Skip.lineComment "--";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue