summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-23 12:15:38 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-23 12:20:47 +0100
commita1d47695a2af5afa466c21ad812a1a8212780293 (patch)
treea3210a23abbecaf69479f1da8772e4e3f7cce32d /src/syntax
parent6e65ebf23641a755b0088569751c0b02e898f1e9 (diff)
Switch to ecow
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/ast.rs2
-rw-r--r--src/syntax/lexer.rs2
-rw-r--r--src/syntax/node.rs3
-rw-r--r--src/syntax/parser.rs2
4 files changed, 5 insertions, 4 deletions
diff --git a/src/syntax/ast.rs b/src/syntax/ast.rs
index af7fedce..6075b3b1 100644
--- a/src/syntax/ast.rs
+++ b/src/syntax/ast.rs
@@ -5,13 +5,13 @@
use std::num::NonZeroUsize;
use std::ops::Deref;
+use ecow::EcoString;
use unscanny::Scanner;
use super::{
is_id_continue, is_id_start, is_newline, split_newlines, Span, SyntaxKind, SyntaxNode,
};
use crate::geom::{AbsUnit, AngleUnit};
-use crate::util::EcoString;
/// A typed AST node.
pub trait AstNode: Sized {
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs
index b79b4c7f..bd168f0a 100644
--- a/src/syntax/lexer.rs
+++ b/src/syntax/lexer.rs
@@ -1,9 +1,9 @@
+use ecow::{format_eco, EcoString};
use unicode_segmentation::UnicodeSegmentation;
use unicode_xid::UnicodeXID;
use unscanny::Scanner;
use super::{ErrorPos, SyntaxKind};
-use crate::util::{format_eco, EcoString};
/// Splits up a string of source code into tokens.
#[derive(Clone)]
diff --git a/src/syntax/node.rs b/src/syntax/node.rs
index e153b0bf..d90a44ac 100644
--- a/src/syntax/node.rs
+++ b/src/syntax/node.rs
@@ -3,10 +3,11 @@ use std::ops::{Deref, Range};
use std::rc::Rc;
use std::sync::Arc;
+use ecow::EcoString;
+
use super::ast::AstNode;
use super::{SourceId, Span, SyntaxKind};
use crate::diag::SourceError;
-use crate::util::EcoString;
/// A node in the untyped syntax tree.
#[derive(Clone, PartialEq, Hash)]
diff --git a/src/syntax/parser.rs b/src/syntax/parser.rs
index cd318983..e5898e88 100644
--- a/src/syntax/parser.rs
+++ b/src/syntax/parser.rs
@@ -1,10 +1,10 @@
use std::collections::HashSet;
use std::ops::Range;
+use ecow::{format_eco, EcoString};
use unicode_math_class::MathClass;
use super::{ast, is_newline, ErrorPos, LexMode, Lexer, SyntaxKind, SyntaxNode};
-use crate::util::{format_eco, EcoString};
/// Parse a source file.
pub fn parse(text: &str) -> SyntaxNode {