mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
support literal suffixes
This commit is contained in:
parent
73ded3c63c
commit
359e70d1b2
7 changed files with 40 additions and 2 deletions
|
@ -27,6 +27,10 @@ pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>)
|
|||
errors.push(SyntaxError::new(UnclosedByte, literal_range));
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
errors.push(SyntaxError::new(EmptyByte, literal_range));
|
||||
}
|
||||
|
|
|
@ -32,6 +32,10 @@ pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec<
|
|||
if !components.has_closing_quote {
|
||||
errors.push(SyntaxError::new(UnclosedString, literal_range));
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -30,6 +30,10 @@ pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec<SyntaxError>)
|
|||
errors.push(SyntaxError::new(UnclosedChar, literal_range));
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
errors.push(SyntaxError::new(EmptyChar, literal_range));
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@ pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec<SyntaxErr
|
|||
if !components.has_closing_quote {
|
||||
errors.push(SyntaxError::new(UnclosedString, literal_range));
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue