From 0f4db1d261418a6e767384065592ad949a1ba1f6 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 6 Oct 2025 17:05:36 -0700 Subject: [PATCH] Update shrimp.test.ts --- src/parser/shrimp.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/parser/shrimp.test.ts b/src/parser/shrimp.test.ts index 4027d61..5285587 100644 --- a/src/parser/shrimp.test.ts +++ b/src/parser/shrimp.test.ts @@ -234,6 +234,26 @@ describe('Fn', () => { }) }) +describe('abmiguity', () => { + test('parses ambiguous expressions correctly', () => { + expect('a + -3').toMatchTree(` + BinOp + Identifier a + operator + + Number -3 + `) + }) + + test('parses ambiguous expressions correctly', () => { + expect('a-var + a-thing').toMatchTree(` + BinOp + Identifier a-var + operator + + Identifier a-thing + `) + }) +}) + describe('Assignment', () => { test('parses assignment with addition', () => { expect('x = 5 + 3').toMatchTree(`