mirror of
https://github.com/typst/typst
synced 2025-05-16 01:55:28 +08:00
improve some var names
This commit is contained in:
parent
a5d36d6931
commit
457892cd7f
@ -255,8 +255,8 @@ impl Lexer<'_> {
|
|||||||
return SyntaxNode::inner(SyntaxKind::Annotation, subtree);
|
return SyntaxNode::inner(SyntaxKind::Annotation, subtree);
|
||||||
}
|
}
|
||||||
|
|
||||||
let annotation_name = self.annotation_name(current_start);
|
let name = self.annotation_name(current_start);
|
||||||
subtree.push(self.emit_token(annotation_name, current_start));
|
subtree.push(self.emit_token(name, current_start));
|
||||||
|
|
||||||
// Left parenthesis before annotation arguments.
|
// Left parenthesis before annotation arguments.
|
||||||
let current_start = self.s.cursor();
|
let current_start = self.s.cursor();
|
||||||
|
@ -544,7 +544,7 @@ pub fn deduplicate_and_suppress_warnings(
|
|||||||
/// in. If one of the ancestors of the node where the warning occurred has a
|
/// in. If one of the ancestors of the node where the warning occurred has a
|
||||||
/// warning suppression annotation sibling right before it suppressing this
|
/// warning suppression annotation sibling right before it suppressing this
|
||||||
/// particular warning, the warning is considered suppressed.
|
/// particular warning, the warning is considered suppressed.
|
||||||
fn is_warning_suppressed(span: Span, world: &dyn World, identifier: &Identifier) -> bool {
|
fn is_warning_suppressed(span: Span, world: &dyn World, warning: &Identifier) -> bool {
|
||||||
// Don't suppress detached warnings.
|
// Don't suppress detached warnings.
|
||||||
let Some(source) = span.id().and_then(|file| world.source(file).ok()) else {
|
let Some(source) = span.id().and_then(|file| world.source(file).ok()) else {
|
||||||
return false;
|
return false;
|
||||||
@ -559,7 +559,7 @@ fn is_warning_suppressed(span: Span, world: &dyn World, identifier: &Identifier)
|
|||||||
let mut searched_annotation = node.prev_attached_annotation();
|
let mut searched_annotation = node.prev_attached_annotation();
|
||||||
while let Some(sibling) = searched_annotation {
|
while let Some(sibling) = searched_annotation {
|
||||||
let annotation = sibling.cast::<ast::Annotation>().unwrap();
|
let annotation = sibling.cast::<ast::Annotation>().unwrap();
|
||||||
if check_annotation_suppresses_warning(annotation, identifier) {
|
if check_annotation_suppresses_warning(annotation, warning) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
searched_annotation = sibling.prev_attached_annotation();
|
searched_annotation = sibling.prev_attached_annotation();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user