summaryrefslogtreecommitdiffstats
path: root/vendor/rowan/src/green.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /vendor/rowan/src/green.rs
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rowan/src/green.rs')
-rw-r--r--vendor/rowan/src/green.rs42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/rowan/src/green.rs b/vendor/rowan/src/green.rs
new file mode 100644
index 000000000..e2b5b4a4e
--- /dev/null
+++ b/vendor/rowan/src/green.rs
@@ -0,0 +1,42 @@
+mod node;
+mod token;
+mod element;
+mod builder;
+mod node_cache;
+
+use self::element::GreenElement;
+
+pub(crate) use self::{element::GreenElementRef, node::GreenChild};
+
+pub use self::{
+ builder::{Checkpoint, GreenNodeBuilder},
+ node::{Children, GreenNode, GreenNodeData},
+ node_cache::NodeCache,
+ token::{GreenToken, GreenTokenData},
+};
+
+/// SyntaxKind is a type tag for each token or node.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
+pub struct SyntaxKind(pub u16);
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn assert_send_sync() {
+ fn f<T: Send + Sync>() {}
+ f::<GreenNode>();
+ f::<GreenToken>();
+ f::<GreenElement>();
+ }
+
+ #[test]
+ fn test_size_of() {
+ use std::mem::size_of;
+
+ eprintln!("GreenNode {}", size_of::<GreenNode>());
+ eprintln!("GreenToken {}", size_of::<GreenToken>());
+ eprintln!("GreenElement {}", size_of::<GreenElement>());
+ }
+}