fix suffix ranges
This commit is contained in:
@@ -28,7 +28,10 @@ pub(super) fn validate_byte_node(node: ast::Byte, errors: &mut Vec<SyntaxError>)
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
|
||||
@@ -34,7 +34,10 @@ pub(crate) fn validate_byte_string_node(node: ast::ByteString, errors: &mut Vec<
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ pub(super) fn validate_char_node(node: ast::Char, errors: &mut Vec<SyntaxError>)
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
|
||||
if len == 0 {
|
||||
|
||||
@@ -29,7 +29,10 @@ pub(crate) fn validate_string_node(node: ast::String, errors: &mut Vec<SyntaxErr
|
||||
}
|
||||
|
||||
if let Some(range) = components.suffix {
|
||||
errors.push(SyntaxError::new(InvalidSuffix, range));
|
||||
errors.push(SyntaxError::new(
|
||||
InvalidSuffix,
|
||||
range + literal_range.start(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user