From a1d47695a2af5afa466c21ad812a1a8212780293 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 23 Feb 2023 12:15:38 +0100 Subject: Switch to ecow --- src/syntax/ast.rs | 2 +- src/syntax/lexer.rs | 2 +- src/syntax/node.rs | 3 ++- src/syntax/parser.rs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/syntax') 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 { -- cgit v1.2.3