summaryrefslogtreecommitdiff
path: root/dhall_parser/src
diff options
context:
space:
mode:
Diffstat (limited to 'dhall_parser/src')
-rw-r--r--dhall_parser/src/dhall.abnf17
1 files changed, 9 insertions, 8 deletions
diff --git a/dhall_parser/src/dhall.abnf b/dhall_parser/src/dhall.abnf
index 01ec6d8..7ad0b24 100644
--- a/dhall_parser/src/dhall.abnf
+++ b/dhall_parser/src/dhall.abnf
@@ -688,17 +688,18 @@ union-type-or-literal =
empty-union-type = ""
non-empty-union-type-or-literal =
- any-label whsp
- ( "=" whsp expression union-type-entries
- / ":" whsp1 expression [ whsp "|" whsp non-empty-union-type-or-literal ]
- )
-union-type-entries = *(whsp "|" whsp union-type-entry)
+ any-label [ whsp ( union-literal-variant-value / union-type-or-literal-variant-type) ]
+
+; = True | ...
+union-literal-variant-value = "=" whsp expression *(whsp "|" whsp union-type-entry)
union-type-entry = any-label whsp ":" whsp1 expression
-; "[1, 2, 3]"
-; `empty-list-or-optional` handles empty lists
-non-empty-list-literal = "[" whsp expression whsp *("," whsp expression whsp) "]"
+; : Integer | ...
+; | ...
+union-type-or-literal-variant-type = [ ":" whsp1 expression ] [ whsp "|" whsp non-empty-union-type-or-literal ]
+non-empty-list-literal = "[" whsp expression whsp *("," whsp expression whsp) "]"
+
; This just adds surrounding whitespace for the top-level of the program
complete-expression = whsp expression whsp