From 9b2f0cb968847f7c692d6d3734bdfe89fd139451 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Thu, 29 Jun 2023 12:54:40 -0600 Subject: [PATCH] Removed pipeline and compose operators --- Program.cs | 16 +++------------- grammar.txt | 1 - 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/Program.cs b/Program.cs index 2e01266..b49856e 100644 --- a/Program.cs +++ b/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 '#': diff --git a/grammar.txt b/grammar.txt index 7d3afb7..17e22b9 100644 --- a/grammar.txt +++ b/grammar.txt @@ -17,7 +17,6 @@ binary -> expression operator expression ; operator -> | "==" | "!=" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" - | "|>" | "<|" | ">>" | "<<" | "++" ; pattern -> "_" | record_pattern | variant_pattern ; record_pattern -> "{" ( identifier ( "=" pattern )? ( "," identifier ( "=" pattern )? )* ) ( "|" identifier ) "}"