Fix parser bug

This commit is contained in:
Greg Shuflin 2021-10-30 17:32:17 -07:00
parent e7308485df
commit 53112c9f9d
2 changed files with 4 additions and 5 deletions

View File

@ -324,6 +324,9 @@ macro_rules! delimited {
let peek = $self.token_handler.peek();
match peek.get_kind() {
$end | EOF => break,
Newline | Semicolon => {
$self.token_handler.next(); continue;
},
_ => (),
}
if !$strictness {
@ -456,6 +459,7 @@ impl Parser {
VariantKind::TupleStruct(tuple_members)
},
LCurlyBrace => {
println!("ARAH");
let typed_identifier_list = delimited!(self, LCurlyBrace, typed_identifier, Comma, RCurlyBrace);
VariantKind::Record(typed_identifier_list)
},

View File

@ -248,8 +248,6 @@ fn duplicate_modules() {
#[test]
fn duplicate_struct_members() {
//TODO this is a parser error
/*
let source = r#"
type Tarak = Tarak {
loujet: i32,
@ -257,9 +255,6 @@ fn duplicate_struct_members() {
mets: i32,
}
"#;
*/
let source = r#" type Tarak = Tarak { loujet: i32, mets: i32, mets: i32 } "#;
let (_, output) = add_symbols(source);
let errs = output.unwrap_err();