diff options
Diffstat (limited to 'crates/typst-syntax/src')
| -rw-r--r-- | crates/typst-syntax/src/ast.rs | 2 | ||||
| -rw-r--r-- | crates/typst-syntax/src/file.rs | 2 | ||||
| -rw-r--r-- | crates/typst-syntax/src/highlight.rs | 3 | ||||
| -rw-r--r-- | crates/typst-syntax/src/lexer.rs | 2 | ||||
| -rw-r--r-- | crates/typst-syntax/src/node.rs | 4 | ||||
| -rw-r--r-- | crates/typst-syntax/src/parser.rs | 2 | ||||
| -rw-r--r-- | crates/typst-syntax/src/reparser.rs | 4 | ||||
| -rw-r--r-- | crates/typst-syntax/src/source.rs | 4 | ||||
| -rw-r--r-- | crates/typst-syntax/src/span.rs | 4 |
9 files changed, 13 insertions, 14 deletions
diff --git a/crates/typst-syntax/src/ast.rs b/crates/typst-syntax/src/ast.rs index 8da045e6..09157bbd 100644 --- a/crates/typst-syntax/src/ast.rs +++ b/crates/typst-syntax/src/ast.rs @@ -8,7 +8,7 @@ use std::ops::Deref; use ecow::EcoString; use unscanny::Scanner; -use super::{ +use crate::{ is_id_continue, is_id_start, is_newline, split_newlines, Span, SyntaxKind, SyntaxNode, }; diff --git a/crates/typst-syntax/src/file.rs b/crates/typst-syntax/src/file.rs index 8f07cc92..40659c6a 100644 --- a/crates/typst-syntax/src/file.rs +++ b/crates/typst-syntax/src/file.rs @@ -10,7 +10,7 @@ use ecow::{eco_format, EcoString}; use once_cell::sync::Lazy; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use super::is_ident; +use crate::is_ident; /// The global package-path interner. static INTERNER: Lazy<RwLock<Interner>> = diff --git a/crates/typst-syntax/src/highlight.rs b/crates/typst-syntax/src/highlight.rs index cdf6a13d..99fbf4fe 100644 --- a/crates/typst-syntax/src/highlight.rs +++ b/crates/typst-syntax/src/highlight.rs @@ -404,9 +404,8 @@ fn highlight_html_impl(html: &mut String, node: &LinkedNode) { #[cfg(test)] mod tests { - use std::ops::Range; - use super::*; + use std::ops::Range; #[test] fn test_highlighting() { diff --git a/crates/typst-syntax/src/lexer.rs b/crates/typst-syntax/src/lexer.rs index ffe53145..156f9404 100644 --- a/crates/typst-syntax/src/lexer.rs +++ b/crates/typst-syntax/src/lexer.rs @@ -4,7 +4,7 @@ use unicode_script::{Script, UnicodeScript}; use unicode_segmentation::UnicodeSegmentation; use unscanny::Scanner; -use super::SyntaxKind; +use crate::SyntaxKind; /// Splits up a string of source code into tokens. #[derive(Clone)] diff --git a/crates/typst-syntax/src/node.rs b/crates/typst-syntax/src/node.rs index d9c80a24..d70f39b7 100644 --- a/crates/typst-syntax/src/node.rs +++ b/crates/typst-syntax/src/node.rs @@ -5,8 +5,8 @@ use std::sync::Arc; use ecow::{eco_vec, EcoString, EcoVec}; -use super::ast::AstNode; -use super::{FileId, Span, SyntaxKind}; +use crate::ast::AstNode; +use crate::{FileId, Span, SyntaxKind}; /// A node in the untyped syntax tree. #[derive(Clone, Eq, PartialEq, Hash)] diff --git a/crates/typst-syntax/src/parser.rs b/crates/typst-syntax/src/parser.rs index 9397952f..11bb4e8d 100644 --- a/crates/typst-syntax/src/parser.rs +++ b/crates/typst-syntax/src/parser.rs @@ -4,7 +4,7 @@ use std::ops::Range; use ecow::{eco_format, EcoString}; use unicode_math_class::MathClass; -use super::{ast, is_newline, LexMode, Lexer, SyntaxKind, SyntaxNode}; +use crate::{ast, is_newline, LexMode, Lexer, SyntaxKind, SyntaxNode}; /// Parse a source file. #[tracing::instrument(skip_all)] diff --git a/crates/typst-syntax/src/reparser.rs b/crates/typst-syntax/src/reparser.rs index f7f89a3f..1374bde0 100644 --- a/crates/typst-syntax/src/reparser.rs +++ b/crates/typst-syntax/src/reparser.rs @@ -1,6 +1,6 @@ use std::ops::Range; -use super::{ +use crate::{ is_newline, parse, reparse_block, reparse_markup, Span, SyntaxKind, SyntaxNode, }; @@ -246,7 +246,7 @@ fn next_nesting(node: &SyntaxNode, nesting: &mut usize) { mod tests { use std::ops::Range; - use super::super::{parse, Source, Span}; + use crate::{parse, Source, Span}; #[track_caller] fn test(prev: &str, range: Range<usize>, with: &str, incremental: bool) { diff --git a/crates/typst-syntax/src/source.rs b/crates/typst-syntax/src/source.rs index f3392889..4bf4045a 100644 --- a/crates/typst-syntax/src/source.rs +++ b/crates/typst-syntax/src/source.rs @@ -7,9 +7,9 @@ use std::sync::Arc; use comemo::Prehashed; -use super::reparser::reparse; -use super::{is_newline, parse, FileId, LinkedNode, Span, SyntaxNode}; +use crate::reparser::reparse; use crate::VirtualPath; +use crate::{is_newline, parse, FileId, LinkedNode, Span, SyntaxNode}; /// A source file. /// diff --git a/crates/typst-syntax/src/span.rs b/crates/typst-syntax/src/span.rs index d715af1c..5b8fd693 100644 --- a/crates/typst-syntax/src/span.rs +++ b/crates/typst-syntax/src/span.rs @@ -2,7 +2,7 @@ use std::fmt::{self, Debug, Formatter}; use std::num::NonZeroU64; use std::ops::Range; -use super::FileId; +use crate::FileId; /// A unique identifier for a syntax node. /// @@ -119,7 +119,7 @@ impl<T: Debug> Debug for Spanned<T> { #[cfg(test)] mod tests { - use super::{FileId, Span}; + use crate::{FileId, Span}; #[test] fn test_span_encoding() { |
