1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! All the types that make up a parsed Lua syntax tree.
//!
//! The main entry point is [`Ast`], which holds the top level block of statements
//! and any comments found in the source. For Luau code with type annotations,
//! use [`AstWithTypes`] instead.
use Vec;
/// Shared building blocks: identifiers, blocks, comments, parameters.
/// Expression nodes (`1 + 2`, `foo()`, `if/then/else`, etc.).
/// Statement nodes (`local`, `if`, `while`, `return`, etc.).
/// Luau type annotation nodes (`string`, `number?`, `{x: number}`, etc.).
/// Tree traversal with the [`Visitor`](visitor::Visitor) and [`VisitorMut`](visitor::VisitorMut) traits.
pub use *;
pub use *;
pub use *;
pub use *;
/// A complete parsed Lua program.
///
/// Contains the top level block of statements and every comment found in the
/// source. You get this from [`Parser::parse`](crate::Parser::parse).
/// A parsed Luau program with type declarations pulled out separately.
///
/// You get this from [`Parser::parse_with_types`](crate::Parser::parse_with_types).
/// The `type Foo = ...` and `export type Bar = ...` declarations live in
/// `type_declarations` instead of being mixed into the statement list.