Pattern-matching parsing

This commit is contained in:
Dmitry Boulytchev 2018-05-01 02:57:09 +03:00
parent 3f40a66f43
commit de760a2b09
3 changed files with 50 additions and 5 deletions

View file

@ -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 "--";