Correctly escape strings.
This commit is contained in:
parent
eed358f38f
commit
57b79b8ff4
3 changed files with 7 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -99,7 +99,7 @@ checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "granite"
|
name = "granite"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "granite"
|
name = "granite"
|
||||||
version = "1.0.2"
|
version = "1.0.3"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
@ -330,9 +330,13 @@ fn parse(data: &str) -> Result<Program, String> {
|
||||||
} else {
|
} else {
|
||||||
if char == '\\' {
|
if char == '\\' {
|
||||||
if !string_escape { string_escape = true; }
|
if !string_escape { string_escape = true; }
|
||||||
else { argument_builder = format!("{}{}", argument_builder, char); }
|
else {
|
||||||
|
argument_builder = format!("{}{}", argument_builder, char);
|
||||||
|
string_escape = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
argument_builder = format!("{}{}", argument_builder, char);
|
argument_builder = format!("{}{}", argument_builder, char);
|
||||||
|
string_escape = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if char == ',' {
|
} else if char == ',' {
|
||||||
|
|
Loading…
Reference in a new issue