Removed pipeline and compose operators
This commit is contained in:
parent
f1b373c7e6
commit
9b2f0cb968
16
Program.cs
16
Program.cs
@ -104,10 +104,6 @@ public enum TokenType
|
||||
LessEqual, GreaterEqual,
|
||||
SingleArrow,
|
||||
DoubleArrow,
|
||||
PipeRight,
|
||||
PipeLeft,
|
||||
ComposeRight,
|
||||
ComposeLeft,
|
||||
If, Then, Else,
|
||||
When,
|
||||
Is,
|
||||
@ -289,6 +285,7 @@ class Scanner
|
||||
case '.': addToken(TokenType.Period); break;
|
||||
case '*': addToken(TokenType.Asterisk); break;
|
||||
case '/': addToken(TokenType.Slash); break;
|
||||
case '|': addToken(TokenType.Pipe); break;
|
||||
case '-':
|
||||
addToken(match('>') ? TokenType.SingleArrow : TokenType.Minus);
|
||||
break;
|
||||
@ -304,17 +301,10 @@ class Scanner
|
||||
TokenType.Equal);
|
||||
break;
|
||||
case '<':
|
||||
addToken(match('=') ? TokenType.LessEqual :
|
||||
match('<') ? TokenType.ComposeLeft :
|
||||
match('|') ? TokenType.PipeLeft :
|
||||
TokenType.Less);
|
||||
addToken(match('=') ? TokenType.LessEqual : TokenType.Less);
|
||||
break;
|
||||
case '>':
|
||||
addToken(match('=') ? TokenType.GreaterEqual :
|
||||
match('>') ? TokenType.ComposeRight : TokenType.Greater);
|
||||
break;
|
||||
case '|':
|
||||
addToken(match('>') ? TokenType.PipeRight : TokenType.Pipe);
|
||||
addToken(match('=') ? TokenType.GreaterEqual : TokenType.Greater);
|
||||
break;
|
||||
case '"': stringLiteral(); break;
|
||||
case '#':
|
||||
|
@ -17,7 +17,6 @@ binary -> expression operator expression ;
|
||||
operator ->
|
||||
| "==" | "!=" | "<" | "<=" | ">" | ">="
|
||||
| "+" | "-" | "*" | "/"
|
||||
| "|>" | "<|" | ">>" | "<<"
|
||||
| "++" ;
|
||||
pattern -> "_" | record_pattern | variant_pattern ;
|
||||
record_pattern -> "{" ( identifier ( "=" pattern )? ( "," identifier ( "=" pattern )? )* ) ( "|" identifier ) "}"
|
||||
|
Loading…
Reference in New Issue
Block a user