From 8e2c0e345facee83d63991dda548b71e6a0c4cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Mon, 8 Mar 2021 00:15:46 +0100 Subject: error on '(,)'-tuples Currently creats a lot of syntax errors. See #100. --- src/compiler.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/compiler.rs b/src/compiler.rs index 46fe38c..c4f687f 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -691,6 +691,14 @@ impl Compiler { Token::Newline => { self.eat(); } + Token::Comma => { + //TODO(gu): This creates a lot of syntax errors since the compiler panic is + // ignored and the statement is tried as a grouping instead, even though we + // _know_ that this can't be parsed as a grouping either. + // Tracked in #100. + error!(self, "Tuples must begin with an element or ')'."); + return; + } _ => { self.expression(block); num_args += 1; -- cgit v1.2.1