diff options
author | Nadrieril | 2019-03-16 00:18:50 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-16 00:18:50 +0100 |
commit | 5692bf2c8a7acfb90a5d03d0bd360c105ba2a72b (patch) | |
tree | b86ac0beeb06cb9984f1d6a2ba547d391674533e /dhall_core/src/parser.rs | |
parent | 1522469dc0b68c63dbbc81faab057c3d48402657 (diff) |
Store an Option in OptionalLit instead of a vec
Closes #21
Diffstat (limited to '')
-rw-r--r-- | dhall_core/src/parser.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dhall_core/src/parser.rs b/dhall_core/src/parser.rs index 02242bf..9cbd878 100644 --- a/dhall_core/src/parser.rs +++ b/dhall_core/src/parser.rs @@ -648,7 +648,7 @@ rule!(merge_expression<BoxExpr>; rule!(empty_collection<BoxExpr>; children!(x: str, y: expression) => { match x { - "Optional" => bx(Expr::OptionalLit(Some(y), vec![])), + "Optional" => bx(Expr::OptionalLit(Some(y), None)), "List" => bx(Expr::ListLit(Some(y), vec![])), _ => unreachable!(), } @@ -657,7 +657,7 @@ rule!(empty_collection<BoxExpr>; rule!(non_empty_optional<BoxExpr>; children!(x: expression, _y: str, z: expression) => { - bx(Expr::OptionalLit(Some(z), vec![*x])) + bx(Expr::OptionalLit(Some(z), Some(x))) } ); |