From c47b4301351956e37a6d1b85201aafc36d67be93 Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sun, 21 Feb 2021 20:04:17 +0100 Subject: [PATCH 1/5] add methods for arity of syntax nodes --- src/green/element.rs | 4 ++-- src/green/node.rs | 5 +++++ src/syntax.rs | 14 ++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/green/element.rs b/src/green/element.rs index 3a62f47..8b7af64 100644 --- a/src/green/element.rs +++ b/src/green/element.rs @@ -13,7 +13,7 @@ pub(super) type GreenElement = NodeOrToken; pub(crate) type GreenElementRef<'a> = NodeOrToken<&'a GreenNode, &'a GreenToken>; #[repr(transparent)] -pub(super) struct PackedGreenElement { +pub(crate) struct PackedGreenElement { ptr: ErasedPtr, } @@ -113,7 +113,7 @@ impl From for GreenElement { } impl PackedGreenElement { - fn is_node(&self) -> bool { + pub(crate) fn is_node(&self) -> bool { self.ptr as usize & 1 == 0 } diff --git a/src/green/node.rs b/src/green/node.rs index 46a4296..1d7f632 100644 --- a/src/green/node.rs +++ b/src/green/node.rs @@ -115,6 +115,11 @@ impl GreenNode { self.data.header.header.text_len } + #[inline] + pub(crate) fn iter(&self) -> slice::Iter<'_, PackedGreenElement> { + self.data.slice.iter() + } + /// Iterator over all children of this node. #[inline] pub fn children(&self) -> Children<'_> { diff --git a/src/syntax.rs b/src/syntax.rs index fb96173..c6baaab 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -695,6 +695,20 @@ impl SyntaxNode { } } + /// The number of child nodes (!) of this node. + /// + /// If you want to also consider leafs, see [`arity_with_tokens`](SyntaxNode::arity_with_tokens). + #[inline] + pub fn arity(&self) -> usize { + self.green().iter().filter(|&child| child.is_node()).count() + } + + /// The number of children of this node. + #[inline] + pub fn arity_with_tokens(&self) -> usize { + self.data().children.len() + } + /// Returns an iterator along the chain of parents of this node. #[inline] pub fn ancestors(&self) -> impl Iterator> { From d8ce241cf5645dcdc51e81d3b9c6b5e4bd0cead1 Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sun, 21 Feb 2021 20:18:41 +0100 Subject: [PATCH 2/5] derive impl `Display` for `NodeOrToken` --- src/utility_types.rs | 11 +++++++++++ tests/basic.rs | 16 +++++++++++++++- tests/common.rs | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/utility_types.rs b/src/utility_types.rs index 41ea079..88ed89e 100644 --- a/src/utility_types.rs +++ b/src/utility_types.rs @@ -1,3 +1,5 @@ +use std::fmt; + /// Convenience type to represent tree elements which may either be a node or a token. /// /// Used for both red and green tree, references to elements, ... @@ -53,6 +55,15 @@ impl NodeOrToken<&N, &T> { } } +impl fmt::Display for NodeOrToken { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + NodeOrToken::Node(node) => node.fmt(f), + NodeOrToken::Token(token) => token.fmt(f), + } + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum Direction { Next, diff --git a/tests/basic.rs b/tests/basic.rs index f9c2fdd..8aeb207 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -1,6 +1,8 @@ mod common; -use common::{build_recursive, build_tree_with_cache, Element, SyntaxNode}; +use common::{ + build_recursive, build_tree_with_cache, Element, SyntaxElement, SyntaxElementRef, SyntaxNode, SyntaxToken, +}; use cstree::{GreenNodeBuilder, NodeCache, SyntaxKind, TextRange}; use lasso::{Resolver, Rodeo}; @@ -129,3 +131,15 @@ fn inline_resolver() { ); } } + +#[test] +fn assert_debug_display() { + use std::fmt; + fn f() {} + + f::>(); + f::>(); + f::>(); + f::>(); + f::>(); +} diff --git a/tests/common.rs b/tests/common.rs index ffd340a..178c2c9 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -2,6 +2,9 @@ use cstree::{GreenNode, GreenNodeBuilder, Language, NodeCache, SyntaxKind}; use lasso::Interner; pub type SyntaxNode = cstree::SyntaxNode; +pub type SyntaxToken = cstree::SyntaxToken; +pub type SyntaxElement = cstree::SyntaxElement; +pub type SyntaxElementRef<'a, D = (), R = ()> = cstree::SyntaxElementRef<'a, TestLang, D, R>; #[derive(Debug)] pub enum Element<'s> { From fb41635961b777886e348a0417758fca8da29474 Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sun, 21 Feb 2021 20:50:44 +0100 Subject: [PATCH 3/5] newtype default interner --- Cargo.lock | 4 +- Cargo.toml | 2 +- examples/math.rs | 5 +- examples/s_expressions.rs | 5 +- src/green.rs | 2 + src/green/builder.rs | 25 ++++---- src/green/interner.rs | 123 ++++++++++++++++++++++++++++++++++++++ src/lib.rs | 3 +- src/serde_impls.rs | 5 +- src/syntax.rs | 4 +- src/syntax_text.rs | 2 +- tests/sendsync.rs | 6 +- tests/serde.rs | 7 ++- 13 files changed, 164 insertions(+), 29 deletions(-) create mode 100644 src/green/interner.rs diff --git a/Cargo.lock b/Cargo.lock index 7e3ca67..7c4c2d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "lasso" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17823787ed7c3f2ce99d4865d41edd4407b2fb6d9e71d534ec69d832a3ec2df3" +checksum = "4efb7b456e95cc1ae2de7b18b1e4d791467b46f0a3d02464e5a16ea502091640" dependencies = [ "hashbrown", ] diff --git a/Cargo.toml b/Cargo.toml index 07dfbfc..6920393 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ repository = "https://github.com/domenicquirl/cstree" readme = "README.md" [dependencies] -lasso = "0.4.1" +lasso = "0.5" text-size = "1.0.0" fxhash= "0.2.1" servo_arc = { path = "vendor/servo_arc" } diff --git a/examples/math.rs b/examples/math.rs index 47414a2..03b114b 100644 --- a/examples/math.rs +++ b/examples/math.rs @@ -13,7 +13,10 @@ //! - "+" Token(Add) //! - "4" Token(Number) -use cstree::{interning::Resolver, GreenNodeBuilder, NodeOrToken}; +use cstree::{ + interning::{IntoResolver, Resolver}, + GreenNodeBuilder, NodeOrToken, +}; use std::iter::Peekable; #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/examples/s_expressions.rs b/examples/s_expressions.rs index f7475fd..e0b7642 100644 --- a/examples/s_expressions.rs +++ b/examples/s_expressions.rs @@ -59,7 +59,10 @@ impl cstree::Language for Lang { /// offsets and parent pointers. /// cstree also deduplicates the actual source string in addition to the tree nodes, so we will need /// the Resolver to get the real text back from the interned representation. -use cstree::{interning::Resolver, GreenNode}; +use cstree::{ + interning::{IntoResolver, Resolver}, + GreenNode, +}; /// You can construct GreenNodes by hand, but a builder is helpful for top-down parsers: it maintains /// a stack of currently in-progress nodes. diff --git a/src/green.rs b/src/green.rs index ee352ac..6379106 100644 --- a/src/green.rs +++ b/src/green.rs @@ -4,6 +4,7 @@ mod builder; mod element; +mod interner; mod node; mod token; @@ -12,6 +13,7 @@ use self::element::{GreenElement, PackedGreenElement}; pub use self::{ builder::{Checkpoint, GreenNodeBuilder, NodeCache}, + interner::TokenInterner, node::{Children, GreenNode}, token::GreenToken, }; diff --git a/src/green/builder.rs b/src/green/builder.rs index d72a5f3..973c3d4 100644 --- a/src/green/builder.rs +++ b/src/green/builder.rs @@ -1,11 +1,10 @@ -use std::{convert::TryFrom, num::NonZeroUsize}; +use std::convert::TryFrom; -use fxhash::{FxBuildHasher, FxHashMap}; -use lasso::{Capacity, Rodeo, Spur}; +use fxhash::FxHashMap; use text_size::TextSize; use crate::{ - green::{GreenElement, GreenNode, GreenToken, SyntaxKind}, + green::{interner::TokenInterner, GreenElement, GreenNode, GreenToken, SyntaxKind}, interning::Interner, NodeOrToken, }; @@ -21,13 +20,13 @@ const CHILDREN_CACHE_THRESHOLD: usize = 3; /// A `NodeCache` deduplicates identical tokens and small nodes during tree construction. /// You can re-use the same cache for multiple similar trees with [`GreenNodeBuilder::with_cache`]. #[derive(Debug)] -pub struct NodeCache<'i, I = Rodeo> { +pub struct NodeCache<'i, I = TokenInterner> { nodes: FxHashMap, tokens: FxHashMap, interner: MaybeOwned<'i, I>, } -impl NodeCache<'static, Rodeo> { +impl NodeCache<'static> { /// Constructs a new, empty cache. /// /// By default, this will also create a default interner to deduplicate source text (strings) across @@ -53,11 +52,7 @@ impl NodeCache<'static, Rodeo> { Self { nodes: FxHashMap::default(), tokens: FxHashMap::default(), - interner: MaybeOwned::Owned(Rodeo::with_capacity_and_hasher( - // capacity values suggested by author of `lasso` - Capacity::new(512, unsafe { NonZeroUsize::new_unchecked(4096) }), - FxBuildHasher::default(), - )), + interner: MaybeOwned::Owned(TokenInterner::new()), } } } @@ -77,7 +72,7 @@ where /// # Examples /// ``` /// # use cstree::*; - /// # use lasso::Rodeo; + /// use lasso::Rodeo; /// # const ROOT: SyntaxKind = SyntaxKind(0); /// # const INT: SyntaxKind = SyntaxKind(1); /// # fn parse(b: &mut GreenNodeBuilder, s: &str) {} @@ -239,7 +234,7 @@ pub struct Checkpoint(usize); /// /// # Examples /// ``` -/// # use cstree::*; +/// # use cstree::{*, interning::IntoResolver}; /// # const ROOT: SyntaxKind = SyntaxKind(0); /// # const INT: SyntaxKind = SyntaxKind(1); /// let mut builder = GreenNodeBuilder::new(); @@ -254,13 +249,13 @@ pub struct Checkpoint(usize); /// assert_eq!(int.as_token().unwrap().text(&resolver), "42"); /// ``` #[derive(Debug)] -pub struct GreenNodeBuilder<'cache, 'interner, I = Rodeo> { +pub struct GreenNodeBuilder<'cache, 'interner, I = TokenInterner> { cache: MaybeOwned<'cache, NodeCache<'interner, I>>, parents: Vec<(SyntaxKind, usize)>, children: Vec, } -impl GreenNodeBuilder<'static, 'static, Rodeo> { +impl GreenNodeBuilder<'static, 'static> { /// Creates new builder with an empty [`NodeCache`]. pub fn new() -> Self { Self { diff --git a/src/green/interner.rs b/src/green/interner.rs new file mode 100644 index 0000000..90d38cb --- /dev/null +++ b/src/green/interner.rs @@ -0,0 +1,123 @@ +use std::num::NonZeroUsize; + +use fxhash::FxBuildHasher; +use lasso::{Capacity, Interner, IntoReader, IntoReaderAndResolver, IntoResolver, Reader, Resolver, Rodeo, Spur}; + +/// The default [`Interner`] used to deduplicate green token strings. +pub struct TokenInterner { + rodeo: Rodeo, +} + +impl TokenInterner { + pub(super) fn new() -> Self { + Self { + rodeo: Rodeo::with_capacity_and_hasher( + // capacity values suggested by author of `lasso` + Capacity::new(512, unsafe { NonZeroUsize::new_unchecked(4096) }), + FxBuildHasher::default(), + ), + } + } +} + +impl Resolver for TokenInterner { + #[inline] + fn resolve<'a>(&'a self, key: &Spur) -> &'a str { + self.rodeo.resolve(key) + } + + #[inline] + fn try_resolve<'a>(&'a self, key: &Spur) -> Option<&'a str> { + self.rodeo.try_resolve(key) + } + + #[inline] + unsafe fn resolve_unchecked<'a>(&'a self, key: &Spur) -> &'a str { + self.rodeo.resolve_unchecked(key) + } + + #[inline] + fn contains_key(&self, key: &Spur) -> bool { + self.rodeo.contains_key(key) + } + + #[inline] + fn len(&self) -> usize { + self.rodeo.len() + } +} + +impl Reader for TokenInterner { + #[inline] + fn get(&self, val: &str) -> Option { + self.rodeo.get(val) + } + + #[inline] + fn contains(&self, val: &str) -> bool { + self.rodeo.contains(val) + } +} + +impl IntoResolver for TokenInterner { + type Resolver = as IntoResolver>::Resolver; + + #[inline] + fn into_resolver(self) -> Self::Resolver + where + Self: 'static, + { + self.rodeo.into_resolver() + } + + #[inline] + fn into_resolver_boxed(self: Box) -> Self::Resolver + where + Self: 'static, + { + Rodeo::::into_resolver_boxed(Box::new(self.rodeo)) + } +} + +impl Interner for TokenInterner { + #[inline] + fn get_or_intern(&mut self, val: &str) -> Spur { + self.rodeo.get_or_intern(val) + } + + #[inline] + fn try_get_or_intern(&mut self, val: &str) -> lasso::LassoResult { + self.rodeo.try_get_or_intern(val) + } + + #[inline] + fn get_or_intern_static(&mut self, val: &'static str) -> Spur { + self.rodeo.get_or_intern_static(val) + } + + #[inline] + fn try_get_or_intern_static(&mut self, val: &'static str) -> lasso::LassoResult { + self.rodeo.try_get_or_intern_static(val) + } +} + +impl IntoReader for TokenInterner { + type Reader = as IntoReader>::Reader; + + #[inline] + fn into_reader(self) -> Self::Reader + where + Self: 'static, + { + self.rodeo.into_reader() + } + + fn into_reader_boxed(self: Box) -> Self::Reader + where + Self: 'static, + { + Rodeo::::into_reader_boxed(Box::new(self.rodeo)) + } +} + +impl IntoReaderAndResolver for TokenInterner {} diff --git a/src/lib.rs b/src/lib.rs index 91c24dd..914ae8b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,8 @@ mod utility_types; /// Types and Traits for efficient String storage and deduplication. pub mod interning { - pub use lasso::{Interner, Reader, Resolver}; + pub use crate::green::TokenInterner; + pub use lasso::{Interner, IntoReader, IntoReaderAndResolver, IntoResolver, Reader, Resolver}; } use std::fmt; diff --git a/src/serde_impls.rs b/src/serde_impls.rs index 654a691..a30373f 100644 --- a/src/serde_impls.rs +++ b/src/serde_impls.rs @@ -1,6 +1,9 @@ //! Serialization and Deserialization for syntax trees. -use crate::{interning::Resolver, GreenNodeBuilder, Language, NodeOrToken, SyntaxKind, SyntaxNode, WalkEvent}; +use crate::{ + interning::{IntoResolver, Resolver}, + GreenNodeBuilder, Language, NodeOrToken, SyntaxKind, SyntaxNode, WalkEvent, +}; use serde::{ de::{Error, SeqAccess, Visitor}, ser::SerializeTuple, diff --git a/src/syntax.rs b/src/syntax.rs index c6baaab..c7eb326 100644 --- a/src/syntax.rs +++ b/src/syntax.rs @@ -443,7 +443,7 @@ impl SyntaxNode { /// /// # Example /// ``` - /// # use cstree::*; + /// # use cstree::{*, interning::TokenInterner}; /// # #[allow(non_camel_case_types)] /// #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] /// #[repr(u16)] @@ -468,7 +468,7 @@ impl SyntaxNode { /// } /// # const ROOT: cstree::SyntaxKind = cstree::SyntaxKind(0); /// # const TOKEN: cstree::SyntaxKind = cstree::SyntaxKind(1); - /// # type SyntaxNode = cstree::SyntaxNode>; + /// # type SyntaxNode = cstree::SyntaxNode; /// let mut builder = GreenNodeBuilder::new(); /// builder.start_node(ROOT); /// builder.token(TOKEN, "content"); diff --git a/src/syntax_text.rs b/src/syntax_text.rs index 62e9500..79bb2d7 100644 --- a/src/syntax_text.rs +++ b/src/syntax_text.rs @@ -13,7 +13,7 @@ use crate::{interning::Resolver, Language, SyntaxNode, SyntaxToken, TextRange, T /// /// # Example /// ``` -/// # use cstree::*; +/// # use cstree::{*, interning::IntoResolver}; /// # #[allow(non_camel_case_types)] /// # #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] /// # #[repr(u16)] diff --git a/tests/sendsync.rs b/tests/sendsync.rs index 6886c3c..b347ca9 100644 --- a/tests/sendsync.rs +++ b/tests/sendsync.rs @@ -7,8 +7,10 @@ use crossbeam_utils::thread::scope; use std::{thread, time::Duration}; use common::{build_recursive, Element, SyntaxNode}; -use cstree::GreenNodeBuilder; -use lasso::Resolver; +use cstree::{ + interning::{IntoResolver, Resolver}, + GreenNodeBuilder, +}; fn build_tree(root: &Element<'_>) -> SyntaxNode { let mut builder = GreenNodeBuilder::new(); diff --git a/tests/serde.rs b/tests/serde.rs index 8b1bad5..5537e84 100644 --- a/tests/serde.rs +++ b/tests/serde.rs @@ -1,10 +1,13 @@ #![cfg(feature = "serde1")] +#[allow(unused)] mod common; use common::{Element, SyntaxNode}; -use cstree::{GreenNodeBuilder, NodeCache, NodeOrToken}; -use lasso::Resolver; +use cstree::{ + interning::{IntoResolver, Resolver}, + GreenNodeBuilder, NodeCache, NodeOrToken, +}; use serde_test::Token; use std::fmt; From 62bbe9ec54776d90aed02e92e46df7058ad444ee Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sun, 21 Feb 2021 20:52:10 +0100 Subject: [PATCH 4/5] untrack `Cargo.lock` --- .gitignore | 3 +- Cargo.lock | 339 ----------------------------------------------------- 2 files changed, 2 insertions(+), 340 deletions(-) delete mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 6b4fd4c..af79ea5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode target -*checksum* \ No newline at end of file +*checksum* +Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 7c4c2d1..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,339 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "ahash" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" - -[[package]] -name = "aho-corasick" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" -dependencies = [ - "memchr", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "byteorder" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "crossbeam-utils" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" -dependencies = [ - "autocfg", - "cfg-if", - "lazy_static", -] - -[[package]] -name = "cstree" -version = "0.0.2" -dependencies = [ - "crossbeam-utils", - "fxhash", - "lasso", - "m_lexer", - "parking_lot", - "serde", - "serde_json", - "serde_test", - "servo_arc", - "text-size", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" -dependencies = [ - "ahash", -] - -[[package]] -name = "instant" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "lasso" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4efb7b456e95cc1ae2de7b18b1e4d791467b46f0a3d02464e5a16ea502091640" -dependencies = [ - "hashbrown", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.82" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" - -[[package]] -name = "lock_api" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "m_lexer" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e51ebf91162d585a5bae05e4779efc4a276171cb880d61dd6fab11c98467a7" -dependencies = [ - "regex", -] - -[[package]] -name = "memchr" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" - -[[package]] -name = "nodrop" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" - -[[package]] -name = "parking_lot" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "proc-macro2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "regex" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-syntax" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "166b2349061381baf54a58e4b13c89369feb0ef2eaa57198899e2312aac30aab" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_test" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd7d96489b14fa2f4a89be299ac117c8023d1ead9aaee963a2dde72dad4d14b" -dependencies = [ - "serde", -] - -[[package]] -name = "servo_arc" -version = "0.1.1" -dependencies = [ - "nodrop", - "serde", - "stable_deref_trait", -] - -[[package]] -name = "smallvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "syn" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "text-size" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288cb548dbe72b652243ea797201f3d481a0609a967980fcc5b2315ea811560a" - -[[package]] -name = "thread_local" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" From b752ab4444aeecaf7bb77a402b03bc70241d666a Mon Sep 17 00:00:00 2001 From: Domenic Quirl Date: Sun, 21 Feb 2021 20:53:01 +0100 Subject: [PATCH 5/5] update version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 6920393..fe45624 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2018" name = "cstree" -version = "0.0.2" +version = "0.2.0" authors = ["Domenic Quirl ", "Aleksey Kladov "] description = "Library for generic lossless syntax trees" license = "MIT OR Apache-2.0"