From b72c6e99923183661e2be23d62a3d4fe7b2828dc Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Wed, 28 Jun 2023 16:38:00 -0600 Subject: [PATCH] Parse string concatenation --- Parser.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Parser.cs b/Parser.cs index 9db5c7b..e0efae7 100644 --- a/Parser.cs +++ b/Parser.cs @@ -142,7 +142,9 @@ class Parser private Expr sum() => binaryLeft(product, TokenType.Minus, TokenType.Plus); - private Expr product() => binaryLeft(unary, TokenType.Slash, TokenType.Asterisk); + private Expr product() => binaryLeft(concat, TokenType.Slash, TokenType.Asterisk); + + private Expr concat() => binaryLeft(unary, TokenType.PlusPlus); private Expr unary() {