mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00
fixed a bug with inner types, like [int/string], always being parsed as single types, even though this isn't necessary.
This commit is contained in:
parent
05ecc809c3
commit
fea095a8d6
@ -379,7 +379,10 @@ fn parse_type(file: &mut File) -> Result<VType, ParseError> {
|
|||||||
fn parse_type_adv(file: &mut File, in_fn_args: bool) -> Result<(VType, bool), ParseError> {
|
fn parse_type_adv(file: &mut File, in_fn_args: bool) -> Result<(VType, bool), ParseError> {
|
||||||
let mut types = vec![];
|
let mut types = vec![];
|
||||||
let mut closed_fn_args = false;
|
let mut closed_fn_args = false;
|
||||||
|
let mut count = 0;
|
||||||
loop {
|
loop {
|
||||||
|
count += 1;
|
||||||
|
eprintln!("count: {count}");
|
||||||
let (st, closed_bracket) = parse_single_type_adv(file, in_fn_args)?;
|
let (st, closed_bracket) = parse_single_type_adv(file, in_fn_args)?;
|
||||||
types.push(st);
|
types.push(st);
|
||||||
if closed_bracket {
|
if closed_bracket {
|
||||||
@ -388,7 +391,14 @@ fn parse_type_adv(file: &mut File, in_fn_args: bool) -> Result<(VType, bool), Pa
|
|||||||
}
|
}
|
||||||
file.skip_whitespaces();
|
file.skip_whitespaces();
|
||||||
match file.peek() {
|
match file.peek() {
|
||||||
Some('/') => (),
|
Some('/') => {
|
||||||
|
eprintln!("/ YAY");
|
||||||
|
file.next();
|
||||||
|
}
|
||||||
|
Some(ch) => {
|
||||||
|
eprintln!("Ch: {ch}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
_ => break,
|
_ => break,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +430,7 @@ fn parse_single_type_adv(
|
|||||||
}
|
}
|
||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
types.push(parse_single_type(file)?.into());
|
types.push(parse_type(file)?);
|
||||||
}
|
}
|
||||||
if types.len() == 1 {
|
if types.len() == 1 {
|
||||||
VSingleType::List(types.pop().unwrap())
|
VSingleType::List(types.pop().unwrap())
|
||||||
|
Loading…
Reference in New Issue
Block a user