1 | mod node; |
2 | mod token; |
3 | mod element; |
4 | mod builder; |
5 | mod node_cache; |
6 | |
7 | use self::element::GreenElement; |
8 | |
9 | pub(crate) use self::{element::GreenElementRef, node::GreenChild}; |
10 | |
11 | pub use self::{ |
12 | builder::{Checkpoint, GreenNodeBuilder}, |
13 | node::{Children, GreenNode, GreenNodeData}, |
14 | node_cache::NodeCache, |
15 | token::{GreenToken, GreenTokenData}, |
16 | }; |
17 | |
18 | /// SyntaxKind is a type tag for each token or node. |
19 | #[derive (Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
20 | pub struct SyntaxKind(pub u16); |
21 | |
22 | #[cfg (test)] |
23 | mod tests { |
24 | use super::*; |
25 | |
26 | #[test ] |
27 | fn assert_send_sync() { |
28 | fn f<T: Send + Sync>() {} |
29 | f::<GreenNode>(); |
30 | f::<GreenToken>(); |
31 | f::<GreenElement>(); |
32 | } |
33 | |
34 | #[test ] |
35 | fn test_size_of() { |
36 | use std::mem::size_of; |
37 | |
38 | eprintln!("GreenNode {}" , size_of::<GreenNode>()); |
39 | eprintln!("GreenToken {}" , size_of::<GreenToken>()); |
40 | eprintln!("GreenElement {}" , size_of::<GreenElement>()); |
41 | } |
42 | } |
43 | |