summaryrefslogtreecommitdiff
path: root/dhall_parser/src
diff options
context:
space:
mode:
authorNadrieril2019-04-04 20:20:43 +0200
committerNadrieril2019-04-04 20:25:31 +0200
commitebbd660008dc783ae6c8bc57ca764309ea463a5e (patch)
treedf72d6875bc0af6a0ff297ad091777b99b366e45 /dhall_parser/src
parent7b8c64a754bbd2f9c55cf8992d5bcc8c7a460327 (diff)
Import more trivial changes from upstream
Diffstat (limited to 'dhall_parser/src')
-rw-r--r--dhall_parser/src/dhall.abnf21
1 files changed, 17 insertions, 4 deletions
diff --git a/dhall_parser/src/dhall.abnf b/dhall_parser/src/dhall.abnf
index 9456036..0f07a20 100644
--- a/dhall_parser/src/dhall.abnf
+++ b/dhall_parser/src/dhall.abnf
@@ -635,30 +635,43 @@ primitive-expression =
; '"ABC"'
/ text-literal
+ ; "{ foo = 1 , bar = True }"
+ ; "{ foo : Integer, bar : Bool }"
/ "{" whsp record-type-or-literal whsp "}"
+
+ ; "< Foo : Integer | Bar : Bool >"
+ ; "< Foo : Integer | Bar = True | Baz : Bool >"
+ ; "< Foo | Bar : Bool >"
/ "<" whsp union-type-or-literal whsp ">"
+
+ ; "[1, 2, 3]"
+ ; `empty-collection` handles empty lists
/ non-empty-list-literal
+
; "x"
; "x@2"
/ identifier
- / "(" whsp expression whsp ")"
+
+ ; "( e )"
+ / "(" complete-expression ")"
record-type-or-literal =
empty-record-literal
/ non-empty-record-type-or-literal
/ empty-record-type
+
empty-record-literal = "="
empty-record-type = ""
non-empty-record-type-or-literal =
any-label whsp (non-empty-record-literal / non-empty-record-type)
-non-empty-record-type = ":" whsp1 expression *(whsp "," whsp record-type-entry)
+
+non-empty-record-type = ":" whsp1 expression *(whsp "," whsp record-type-entry)
record-type-entry = any-label whsp ":" whsp1 expression
+
non-empty-record-literal = "=" whsp expression *(whsp "," whsp record-literal-entry)
record-literal-entry = any-label whsp "=" whsp expression
-; "< Foo : Integer | Bar : Bool >"
-; "< Foo : Integer | Bar = True >"
union-type-or-literal =
non-empty-union-type-or-literal
/ empty-union-type