Debian Codegraph @

tests/pass/simple.rs

raw symbols SCIP
1 // Copyright (c) Meta Platforms, Inc. and affiliates.
2 //
3 // This source code is licensed under the MIT license found in the
4 // LICENSE file in the root directory of this source tree
5
6 use libcst_derive::cst_node;
7
8 #[derive(Debug, PartialEq, Eq, Clone)]
9 pub struct WS<'a>(&'a str);
10
11 type TokenRef<'r, 'a> = &'r &'a str;
12
13 #[cst_node]
14 pub enum Foo<'a> {
15 One(One<'a>),
16 Two(Box<Two<'a>>),
17 }
18
19 #[cst_node]
20 pub struct One<'a> {
21 pub two: Box<Two<'a>>,
22 pub header: WS<'a>,
23
24 pub(crate) newline_tok: TokenRef<'a>,
25 }
26
27 #[cst_node]
28 pub struct Two<'a> {
29 pub whitespace_before: WS<'a>,
30 pub(crate) tok: TokenRef<'a>,
31 }
32
33 #[cst_node]
34 struct Thin<'a> {
35 pub whitespace: WS<'a>,
36 }
37
38 #[cst_node]
39 struct Value<'a> {
40 pub value: &'a str,
41 }
42
43 #[cst_node]
44 struct Empty {}
45
46 #[cst_node]
47 enum Smol<'a> {
48 #[allow(dead_code)]
49 Thin(Thin<'a>),
50 #[allow(dead_code)]
51 Empty(Empty),
52 }
53
54 fn main() {}