Fix resource literals not terminating correctly

This commit is contained in:
Tad Hardesty 2018-03-10 20:38:30 -08:00
parent ca07fe3ad5
commit d6597f7101
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}
};

View file

@ -449,7 +449,7 @@ impl<'ctx, I: Iterator<Item=io::Result<u8>>> 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"));