summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dhall_syntax/src/parser.rs1
-rw-r--r--pest_consume_macros/src/make_parser.rs7
2 files changed, 8 insertions, 0 deletions
diff --git a/dhall_syntax/src/parser.rs b/dhall_syntax/src/parser.rs
index 15515f0..a83b8d0 100644
--- a/dhall_syntax/src/parser.rs
+++ b/dhall_syntax/src/parser.rs
@@ -154,6 +154,7 @@ struct Parsers;
#[make_parser(Rule)]
impl Parsers {
+ #[entrypoint]
fn entrypoint<E: Clone>(input_str: &str) -> ParseResult<Expr<E>> {
let pairs = DhallParser::parse(Rule::final_expression, input_str)?;
let rc_input_str = input_str.to_string().into();
diff --git a/pest_consume_macros/src/make_parser.rs b/pest_consume_macros/src/make_parser.rs
index c0594a5..9de2f6f 100644
--- a/pest_consume_macros/src/make_parser.rs
+++ b/pest_consume_macros/src/make_parser.rs
@@ -156,6 +156,13 @@ fn apply_special_attrs(f: &mut ParsedFn, rule_enum: &Ident) -> Result<()> {
);
// `prec_climb` attr
+ let _: () = function
+ .attrs
+ .drain_filter(|attr| attr.path.is_ident("entrypoint"))
+ .map(|_| ())
+ .collect();
+
+ // `prec_climb` attr
let prec_climb_attrs: Vec<_> = function
.attrs
.drain_filter(|attr| attr.path.is_ident("prec_climb"))