Fix parser bug
This commit is contained in:
parent
e7308485df
commit
53112c9f9d
@ -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)
|
||||
},
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user