From 723e75813e773816c3129f11a2b7f3083cadbe6c Mon Sep 17 00:00:00 2001 From: GreasySlug <9619abgoni@gmail.com> Date: Sat, 1 Apr 2023 11:28:31 +0900 Subject: [PATCH] fix(parser): fix conflict --- crates/erg_parser/parse.rs | 4 ++-- crates/erg_parser/tests/parse_test.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/erg_parser/parse.rs b/crates/erg_parser/parse.rs index 44648f12..75d21c77 100644 --- a/crates/erg_parser/parse.rs +++ b/crates/erg_parser/parse.rs @@ -2168,10 +2168,11 @@ impl Parser { obj = obj.attr_expr(ident); } NatLit => { - let index = Literal::from(self.lpop()); + let index = Literal::from(token); obj = obj.tuple_attr_expr(index); } Newline => { + self.restore(token); self.restore(vis); break; } @@ -3017,7 +3018,6 @@ impl Parser { debug_exit_info!(self); return Err(()); }; - self.skip(); if let Some(args) = self .opt_reduce_args(false) .transpose() diff --git a/crates/erg_parser/tests/parse_test.rs b/crates/erg_parser/tests/parse_test.rs index 2e0f6e3b..669a10d3 100644 --- a/crates/erg_parser/tests/parse_test.rs +++ b/crates/erg_parser/tests/parse_test.rs @@ -69,7 +69,7 @@ fn exec_invalid_chunk_prs_err() -> Result<(), ()> { #[test] fn expect_failure_collections_err() -> Result<(), ()> { - expect_failure("tests/invalid_collections.er", 33) + expect_failure("tests/invalid_collections.er", 30) } #[test]