Removed pipeline and compose operators

This commit is contained in:
Brandon Dyck 2023-06-29 12:54:40 -06:00
parent f1b373c7e6
commit 9b2f0cb968
2 changed files with 3 additions and 14 deletions

View File

@ -104,10 +104,6 @@ public enum TokenType
LessEqual, GreaterEqual, LessEqual, GreaterEqual,
SingleArrow, SingleArrow,
DoubleArrow, DoubleArrow,
PipeRight,
PipeLeft,
ComposeRight,
ComposeLeft,
If, Then, Else, If, Then, Else,
When, When,
Is, Is,
@ -289,6 +285,7 @@ class Scanner
case '.': addToken(TokenType.Period); break; case '.': addToken(TokenType.Period); break;
case '*': addToken(TokenType.Asterisk); break; case '*': addToken(TokenType.Asterisk); break;
case '/': addToken(TokenType.Slash); break; case '/': addToken(TokenType.Slash); break;
case '|': addToken(TokenType.Pipe); break;
case '-': case '-':
addToken(match('>') ? TokenType.SingleArrow : TokenType.Minus); addToken(match('>') ? TokenType.SingleArrow : TokenType.Minus);
break; break;
@ -304,17 +301,10 @@ class Scanner
TokenType.Equal); TokenType.Equal);
break; break;
case '<': case '<':
addToken(match('=') ? TokenType.LessEqual : addToken(match('=') ? TokenType.LessEqual : TokenType.Less);
match('<') ? TokenType.ComposeLeft :
match('|') ? TokenType.PipeLeft :
TokenType.Less);
break; break;
case '>': case '>':
addToken(match('=') ? TokenType.GreaterEqual : addToken(match('=') ? TokenType.GreaterEqual : TokenType.Greater);
match('>') ? TokenType.ComposeRight : TokenType.Greater);
break;
case '|':
addToken(match('>') ? TokenType.PipeRight : TokenType.Pipe);
break; break;
case '"': stringLiteral(); break; case '"': stringLiteral(); break;
case '#': case '#':

View File

@ -17,7 +17,6 @@ binary -> expression operator expression ;
operator -> operator ->
| "==" | "!=" | "<" | "<=" | ">" | ">=" | "==" | "!=" | "<" | "<=" | ">" | ">="
| "+" | "-" | "*" | "/" | "+" | "-" | "*" | "/"
| "|>" | "<|" | ">>" | "<<"
| "++" ; | "++" ;
pattern -> "_" | record_pattern | variant_pattern ; pattern -> "_" | record_pattern | variant_pattern ;
record_pattern -> "{" ( identifier ( "=" pattern )? ( "," identifier ( "=" pattern )? )* ) ( "|" identifier ) "}" record_pattern -> "{" ( identifier ( "=" pattern )? ( "," identifier ( "=" pattern )? )* ) ( "|" identifier ) "}"