antimony-lang/antimony

Invalid String exit character

garritfra opened this issue · 3 comments

Double quoted strings could probably be ended by single quoted, and vice versa.

Example:

"It's a test" fails, since ' is considered as an exit character for the string

antimony/src/lexer/mod.rs

Lines 412 to 424 in 5e4f0a1

// FIXME: double quoted strings could probably be ended by single quoted, and vice versa.
// Possible fix: Pass the token of the string beginning down to this method and check against it.
loop {
match self.first() {
'"' | '\'' => break,
'\n' => panic!(
"String does not end on same line. At {}:{}",
self.pos().line,
self.pos().offset
),
_ => self.bump(),
};
}

/assign me

Fixed by 0cbdc88