mirror of
https://github.com/Dummi26/mers.git
synced 2025-03-10 22:37:46 +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
|
&self.pos
|
||||||
}
|
}
|
||||||
pub fn get_ppos(&self) -> &FilePosition {
|
pub fn get_ppos(&self) -> &FilePosition {
|
||||||
&self.pos
|
&self.ppos
|
||||||
}
|
}
|
||||||
pub fn set_pos(&mut self, pos: FilePosition) {
|
pub fn set_pos(&mut self, pos: FilePosition) {
|
||||||
self.pos = pos;
|
self.pos = pos;
|
||||||
|
@ -593,6 +593,7 @@ fn parse_statement_adv(
|
|||||||
let mut pot_float = String::new();
|
let mut pot_float = String::new();
|
||||||
for ch in &mut *file {
|
for ch in &mut *file {
|
||||||
if ch.is_whitespace() || is_delimeter(ch) {
|
if ch.is_whitespace() || is_delimeter(ch) {
|
||||||
|
file.set_pos(*file.get_ppos());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pot_float.push(ch);
|
pot_float.push(ch);
|
||||||
@ -758,14 +759,10 @@ fn parse_function(
|
|||||||
file.skip_whitespaces();
|
file.skip_whitespaces();
|
||||||
// find the arguments to the function
|
// find the arguments to the function
|
||||||
let mut args = Vec::new();
|
let mut args = Vec::new();
|
||||||
loop {
|
if let Some(')') = file.peek() {
|
||||||
match file.peek() {
|
|
||||||
Some(')') => {
|
|
||||||
file.next();
|
file.next();
|
||||||
break;
|
} else {
|
||||||
}
|
loop {
|
||||||
_ => (),
|
|
||||||
}
|
|
||||||
let mut arg_name = String::new();
|
let mut arg_name = String::new();
|
||||||
loop {
|
loop {
|
||||||
let err_fn_arg_name_start = *file.get_pos();
|
let err_fn_arg_name_start = *file.get_pos();
|
||||||
@ -795,6 +792,7 @@ fn parse_function(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Ok(SFunction::new(args, parse_block(file)?))
|
Ok(SFunction::new(args, parse_block(file)?))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user