From d6597f71012cd433c5b8636030930e2365c02196 Mon Sep 17 00:00:00 2001 From: Tad Hardesty Date: Sat, 10 Mar 2018 20:38:30 -0800 Subject: [PATCH] Fix resource literals not terminating correctly --- src/cli/main.rs | 5 ++--- src/dreammaker/lexer.rs | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cli/main.rs b/src/cli/main.rs index 13aff3f4..40254723 100644 --- a/src/cli/main.rs +++ b/src/cli/main.rs @@ -47,9 +47,8 @@ impl Context { flame!("parse"); match self.dm_context.parse_environment(opt.environment.as_ref()) { Ok(tree) => self.objtree = tree, - Err(_) => { - // parse_environment has already pretty_printed the error message - println!("fatal parse error"); + Err(e) => { + println!("fatal parse error: {}", e); std::process::exit(1); } }; diff --git a/src/dreammaker/lexer.rs b/src/dreammaker/lexer.rs index 6c096d1f..d4495fb8 100644 --- a/src/dreammaker/lexer.rs +++ b/src/dreammaker/lexer.rs @@ -449,7 +449,7 @@ impl<'ctx, I: Iterator>> Lexer<'ctx, I> { let mut buf = Vec::new(); loop { match self.next() { - Some(b'\\') => break, + Some(b'\'') => break, Some(ch) => buf.push(ch), None => { self.context.register_error(DMError::new(start_loc, "unterminated resource literal"));