From c484d2cbb269b7114dcdc7946604fa0240a84d8b Mon Sep 17 00:00:00 2001 From: Dummi26 Date: Sat, 15 Apr 2023 15:41:07 +0200 Subject: [PATCH] fixed parser infinite looping because parse_function() on a function with no args (fn my_func() {}) would break before the ')'. --- mers/src/parse/parse.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mers/src/parse/parse.rs b/mers/src/parse/parse.rs index de1c7ae..41e4e64 100755 --- a/mers/src/parse/parse.rs +++ b/mers/src/parse/parse.rs @@ -760,7 +760,10 @@ fn parse_function( let mut args = Vec::new(); loop { match file.peek() { - Some(')') => break, + Some(')') => { + file.next(); + break; + } _ => (), } let mut arg_name = String::new();