mirror of
https://github.com/SpaceManiac/SpacemanDMM.git
synced 2025-12-23 05:36:47 +00:00
Fix resource literals not terminating correctly
This commit is contained in:
parent
ca07fe3ad5
commit
d6597f7101
2 changed files with 3 additions and 4 deletions
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue