From 30a130e3e825a1bdb71d3fe7241b20679e5b1c8f Mon Sep 17 00:00:00 2001 From: Jose Mendoza <56417208+StunxFS@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:09:45 +0000 Subject: [PATCH] change --- rivetc/src/parser.py | 12 ++---------- rivetc/src/register.py | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/rivetc/src/parser.py b/rivetc/src/parser.py index 05df267f6..a397d5673 100644 --- a/rivetc/src/parser.py +++ b/rivetc/src/parser.py @@ -717,9 +717,7 @@ def parse_relational_expr(self): right = ast.EnumLiteral(name, pos, True) else: right = ast.TypeNode(self.parse_type(), pos) - if self.accept(Kind.KwAs): - var = self.parse_var_decl(support_ref = False) - elif self.accept(Kind.Lparen): + if self.accept(Kind.Lparen): var = self.parse_var_decl(support_ref = False) self.expect(Kind.Rparen) else: @@ -1138,13 +1136,7 @@ def parse_match_expr(self): pats.append(branch_expr) if not self.accept(Kind.Comma): break - if self.accept(Kind.KwAs): - report.warn("deprecated", self.tok.pos) - has_var = True - var_is_mut = self.accept(Kind.KwMut) - var_pos = self.tok.pos - var_name = self.parse_name() - elif self.accept(Kind.Lparen): + if self.accept(Kind.Lparen): has_var = True var_is_mut = self.accept(Kind.KwMut) var_pos = self.tok.pos diff --git a/rivetc/src/register.py b/rivetc/src/register.py index f596a26f2..074467806 100644 --- a/rivetc/src/register.py +++ b/rivetc/src/register.py @@ -222,9 +222,9 @@ def walk_decls(self, decls): attributes = decl.attributes ) ) - decl.sym.is_main = decl.is_main except utils.CompilerError(e): report.error(e.args[0], decl.name_pos) + decl.sym.is_main = decl.is_main self.abi = old_abi self.sym = old_sym