rename range -> text_range

This commit is contained in:
Aleksey Kladov 2019-07-20 12:58:27 +03:00
parent 6d5d82e412
commit f3bdbec1b6
54 changed files with 219 additions and 192 deletions

View file

@ -16,6 +16,7 @@ pub(crate) fn validate_block_node(node: ast::Block, errors: &mut Vec<SyntaxError
_ => {}
}
}
errors
.extend(node.attrs().map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().range())))
errors.extend(
node.attrs().map(|attr| SyntaxError::new(InvalidBlockAttr, attr.syntax().text_range())),
)
}

View file

@ -7,7 +7,7 @@ use crate::{
pub(crate) fn validate_field_expr_node(node: ast::FieldExpr, errors: &mut Vec<SyntaxError>) {
if let Some(FieldKind::Index(idx)) = node.field_access() {
if idx.text().chars().any(|c| c < '0' || c > '9') {
errors.push(SyntaxError::new(InvalidTupleIndexFormat, idx.range()));
errors.push(SyntaxError::new(InvalidTupleIndexFormat, idx.text_range()));
}
}
}