Skip to content

Commit

Permalink
[lexer,parser,spec] (myst-lang#96) Implement parsing for match expr…
Browse files Browse the repository at this point in the history
…essions.

`match` expressions essentially act as a syntax sugar for creating an anonymous function and immediately invoking it with some arguments.
  • Loading branch information
faultyserver committed Mar 17, 2018
1 parent ff333b5 commit 1465152
Show file tree
Hide file tree
Showing 6 changed files with 869 additions and 8 deletions.
3 changes: 2 additions & 1 deletion spec/syntax/lexer_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ STATIC_TOKENS = {
Token::Type::SLASH => "/",
Token::Type::EQUAL => "=",
Token::Type::NOT => "!",
Token::Type::MATCH => "=:",
Token::Type::MATCH_OP => "=:",
Token::Type::LESS => "<",
Token::Type::LESSEQUAL => "<=",
Token::Type::EQUALEQUAL => "==",
Expand Down Expand Up @@ -52,6 +52,7 @@ STATIC_TOKENS = {
Token::Type::DEFSTATIC => "defstatic",
Token::Type::DEF => "def",
Token::Type::FN => "fn",
Token::Type::MATCH => "match",
Token::Type::DO => "do",
Token::Type::UNLESS => "unless",
Token::Type::ELSE => "else",
Expand Down
Loading

0 comments on commit 1465152

Please sign in to comment.