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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*!
* Provides the ability to read and write [Smithy](https://github.com/awslabs/smithy) models in their
* own native language representation.
*
* The crate provides two low-level parsers, `parse_model` and `parse_selector` that correspond to the
* core `Model` and `Selector` types. These are decouple to allow for the tool use cases where it is
* unnecessary or even undesirable to parse all selector expressions as well as those cases where
* selector expressions may be useful in non-model scenarios.
*
* This crate also provides implementations of both the core `ModelReader` and `ModelWriter` traits
* for Smithy IDL files.
*
* # Example - Model
*
* The following demonstrates the `SmithyReader` to parse a file into the in-memory model.
*
* ```rust
* use atelier_core::io::read_model_from_file;
* use atelier_smithy::SmithyReader;
* use std::path::PathBuf;
*
* let path = PathBuf::from("tests/good/waiters.smithy");
* let mut reader = SmithyReader::default();
* let result = read_model_from_file(&mut reader, path);
* assert!(result.is_ok());
* ```
*
* # Example - Selector
*
* The following example parses the simple selector expression `"*"`, denoting any shape, into it's
* in-memory model.
*
* ```rust
* use atelier_smithy::parse_selector;
*
* let result = parse_selector("*");
* assert!(result.is_ok());
* ```
*
*/
extern crate pest_derive;
extern crate log;
// ------------------------------------------------------------------------------------------------
// Public Values
// ------------------------------------------------------------------------------------------------
///
/// The file extension used by Smithy IDL files.
///
pub const FILE_EXTENSION: &str = "smithy";
///
/// The name to report in errors in this representation.
///
pub const REPRESENTATION_NAME: &str = "Smithy IDL";
// ------------------------------------------------------------------------------------------------
// Modules
// ------------------------------------------------------------------------------------------------
pub use SmithyReader;
pub use SmithyWriter;
pub use ;