summaryrefslogtreecommitdiff
path: root/dhall_parser/src
diff options
context:
space:
mode:
authorNadrieril2019-04-04 22:28:00 +0200
committerNadrieril2019-04-04 22:28:00 +0200
commite7a58d09748bd333f755a06090f378e31dc6617a (patch)
treee6a5087932b3d3dbcab90473858f6f6d02a2b860 /dhall_parser/src
parent3e4b2dcb8c371045737901c0d49f9d9403109ea0 (diff)
Import union rules from upstream grammar
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