summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dhall/src/typecheck.rs12
-rw-r--r--dhall_core/src/parser.rs31
2 files changed, 25 insertions, 18 deletions
diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs
index 00b8b47..c41bd89 100644
--- a/dhall/src/typecheck.rs
+++ b/dhall/src/typecheck.rs
@@ -223,7 +223,11 @@ where
let kB = match tB {
Const(k) => k,
_ => {
- return Err(TypeError::new(&ctx2, e, InvalidOutputType(tB)));
+ return Err(TypeError::new(
+ &ctx2,
+ e,
+ InvalidOutputType(tB),
+ ));
}
};
@@ -477,7 +481,11 @@ where
match s {
Const(Type) => {}
_ => {
- return Err(TypeError::new(ctx, e, InvalidOptionalType(*t)));
+ return Err(TypeError::new(
+ ctx,
+ e,
+ InvalidOptionalType(*t),
+ ));
}
}
let n = xs.len();
diff --git a/dhall_core/src/parser.rs b/dhall_core/src/parser.rs
index f8e69db..57dd151 100644
--- a/dhall_core/src/parser.rs
+++ b/dhall_core/src/parser.rs
@@ -650,26 +650,25 @@ rule!(non_empty_optional<BoxExpr>;
}
);
-
// List of rules that can be shortcutted as implemented in binop!()
fn can_be_shortcutted(rule: Rule) -> bool {
use Rule::*;
match rule {
- import_alt_expression |
- or_expression |
- plus_expression |
- text_append_expression |
- list_append_expression |
- and_expression |
- combine_expression |
- prefer_expression |
- combine_types_expression |
- times_expression |
- equal_expression |
- not_equal_expression |
- application_expression |
- selector_expression_raw |
- annotated_expression => true,
+ import_alt_expression
+ | or_expression
+ | plus_expression
+ | text_append_expression
+ | list_append_expression
+ | and_expression
+ | combine_expression
+ | prefer_expression
+ | combine_types_expression
+ | times_expression
+ | equal_expression
+ | not_equal_expression
+ | application_expression
+ | selector_expression_raw
+ | annotated_expression => true,
_ => false,
}
}