Find escaped characters in strings
This commit is contained in:
parent
575ebceb7c
commit
5d5ddf30d0
2 changed files with 32 additions and 0 deletions
|
@ -10,6 +10,8 @@ pub trait Lexable {
|
|||
fn is_hash(&self) -> bool;
|
||||
fn is_dot(&self) -> bool;
|
||||
fn is_string_quote(&self) -> bool;
|
||||
fn is_string_escape_leader(&self) -> bool;
|
||||
fn is_string_escaped(&self) -> bool;
|
||||
fn is_newline(&self) -> bool;
|
||||
fn is_eof(&self) -> bool;
|
||||
|
||||
|
@ -44,6 +46,14 @@ impl Lexable for char {
|
|||
*self == '"'
|
||||
}
|
||||
|
||||
fn is_string_escape_leader(&self) -> bool {
|
||||
*self == '\\'
|
||||
}
|
||||
|
||||
fn is_string_escaped(&self) -> bool {
|
||||
*self == '"' || *self == '\\'
|
||||
}
|
||||
|
||||
fn is_boolean_true(&self) -> bool {
|
||||
*self == 't'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue