mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 14:13:52 +01:00
fixed a bug where the character directly following a float literal would be ignored (because parsing the float accidentally used that character). this is what caused [12.5] to break.
This commit is contained in:
parent
c484d2cbb2
commit
ea5346f81c
@ -116,7 +116,7 @@ impl File {
|
||||
&self.pos
|
||||
}
|
||||
pub fn get_ppos(&self) -> &FilePosition {
|
||||
&self.pos
|
||||
&self.ppos
|
||||
}
|
||||
pub fn set_pos(&mut self, pos: FilePosition) {
|
||||
self.pos = pos;
|
||||
|
@ -593,6 +593,7 @@ fn parse_statement_adv(
|
||||
let mut pot_float = String::new();
|
||||
for ch in &mut *file {
|
||||
if ch.is_whitespace() || is_delimeter(ch) {
|
||||
file.set_pos(*file.get_ppos());
|
||||
break;
|
||||
}
|
||||
pot_float.push(ch);
|
||||
@ -758,14 +759,10 @@ fn parse_function(
|
||||
file.skip_whitespaces();
|
||||
// find the arguments to the function
|
||||
let mut args = Vec::new();
|
||||
loop {
|
||||
match file.peek() {
|
||||
Some(')') => {
|
||||
if let Some(')') = file.peek() {
|
||||
file.next();
|
||||
break;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
} else {
|
||||
loop {
|
||||
let mut arg_name = String::new();
|
||||
loop {
|
||||
let err_fn_arg_name_start = *file.get_pos();
|
||||
@ -795,6 +792,7 @@ fn parse_function(
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(SFunction::new(args, parse_block(file)?))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user