mirror of
https://github.com/teo3300/rust-mal.git
synced 2026-01-12 09:15:32 +01:00
No multiline strings for now
Signed-off-by: teo3300 <matteo.rogora@live.it>
This commit is contained in:
@ -116,7 +116,6 @@ pub fn interactive(env: Env) {
|
||||
}
|
||||
Err(ReadlineError::Interrupted) => {
|
||||
parser.clear();
|
||||
// eprintln!("; ... Interrupted");
|
||||
continue;
|
||||
}
|
||||
Err(ReadlineError::Eof) => exit(0),
|
||||
|
||||
@ -99,7 +99,13 @@ impl Reader {
|
||||
if Regex::new(r"^-?[0-9]+$").unwrap().is_match(tk) {
|
||||
Ok(Int(tk.parse::<isize>().unwrap()))
|
||||
} else if tk.starts_with('\"') {
|
||||
Ok(Str(unescape_str(tk)))
|
||||
if tk.len() > 2 && tk.ends_with('\"') {
|
||||
Ok(Str(unescape_str(tk)))
|
||||
} else {
|
||||
Err(MalErr::recoverable(
|
||||
"End of line reached without closing string",
|
||||
))
|
||||
}
|
||||
} else if tk.starts_with(':') {
|
||||
Ok(Key(format!("ʞ{}", tk)))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user