From bf03c6c9a1c6c65a9ec7b36c77f5ec5cbda0f7a9 Mon Sep 17 00:00:00 2001 From: Alula Date: Fri, 28 Aug 2020 03:47:50 +0200 Subject: [PATCH] tsc: do not throw event redefinition error in non-strict mode --- src/text_script.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/text_script.rs b/src/text_script.rs index c0f8353..397b0b3 100644 --- a/src/text_script.rs +++ b/src/text_script.rs @@ -729,7 +729,11 @@ impl TextScript { TextScript::skip_until(b'\n', &mut iter)?; if event_map.contains_key(&event_num) { - return Err(ParseError(format!("Event {} has been defined twice.", event_num))); + if strict { + return Err(ParseError(format!("Event {} has been defined twice.", event_num))); + } else { + continue; + } } let bytecode = TextScript::compile_event(&mut iter, strict)?;