diff options
author | Nadrieril | 2019-12-21 23:00:52 +0000 |
---|---|---|
committer | Nadrieril | 2019-12-21 23:00:52 +0000 |
commit | be9510bc21724077fd27dcdb3825557475a6bb44 (patch) | |
tree | 150b015ee7242a14fc064b65956a0c98c73706b1 /dhall/src | |
parent | a588b946ecc9881090ae52e1a1cf81f4607f3426 (diff) |
Generate parser manually to make the crate publishable
Diffstat (limited to 'dhall/src')
-rw-r--r-- | dhall/src/syntax/text/parser.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dhall/src/syntax/text/parser.rs b/dhall/src/syntax/text/parser.rs index 90cb4b1..832472b 100644 --- a/dhall/src/syntax/text/parser.rs +++ b/dhall/src/syntax/text/parser.rs @@ -156,9 +156,15 @@ lazy_static::lazy_static! { }; } -#[derive(Parser)] -#[grammar = "dhall.pest"] -struct DhallParser; +// Generate pest parser manually becaue otherwise we'd need to modify something outside of OUT_DIR +// and that's forbidden by docs.rs. +// This is equivalent to: +// ``` +// #[derive(Parser) +// #[grammar = "..."] +// struct DhallParser; +// ``` +include!(concat!(env!("OUT_DIR"), "/dhall_parser.rs")); #[pest_consume::parser(parser = DhallParser, rule = Rule)] impl DhallParser { |