grammar Dhall::Parser::CitrusParser
root complete_expression
rule end_of_line
(/\n/i | (/(?:\r)(?:\n)/i)) <Dhall::Parser::EndOfLine>
end rule valid_non_ascii
(/[\u{80}-\u{d7ff}\u{e000}-\u{fffd}\u{10000}-\u{1fffd}\u{20000}-\u{2fffd}\u{30000}-\u{3fffd}\u{40000}-\u{4fffd}\u{50000}-\u{5fffd}\u{60000}-\u{6fffd}\u{70000}-\u{7fffd}\u{80000}-\u{8fffd}\u{90000}-\u{9fffd}\u{a0000}-\u{afffd}\u{b0000}-\u{bfffd}\u{c0000}-\u{cfffd}\u{d0000}-\u{dfffd}\u{e0000}-\u{efffd}\u{f0000}-\u{ffffd}\u{100000}-\u{10fffd}]/i)
end rule tab
(/\t/i)
end rule block_comment
(/(?:\u{7b})(?:\u{2d})/i (block_comment_continue))
end rule block_comment_char
!("{-" | "-}") (/[\u{20}-@\u{5b}-\u{7f}]/i | (valid_non_ascii) | (tab) | (end_of_line))
end rule block_comment_continue
("-}" | block_comment_char+ block_comment_continue | (block_comment block_comment_continue))
end rule not_end_of_line
(/[\u{20}-@\u{5b}-\u{7f}]/i | (valid_non_ascii) | (tab))
end rule line_comment
(/(?:\u{2d})(?:\u{2d})/i ((not_end_of_line)*) (end_of_line))
end rule whitespace_chunk
(/\u{20}/i | (tab) | (end_of_line) | (line_comment) | (block_comment))
end rule whsp
((whitespace_chunk)*)
end rule whsp1
((whitespace_chunk)+)
end rule alpha
(/[a-z]/i)
end rule digit
(/\d/i)
end rule alphanum
((alpha) | (digit))
end rule hexdig
((digit) | /[a-f]/i | (digit) | /[a-f]/i)
end rule simple_label_first_char
((alpha) | `_`)
end rule simple_label_next_char
((alphanum) | /[\u{2d}\/_]/i)
end rule simple_label
(keyword simple_label_next_char+ | !keyword (simple_label_first_char simple_label_next_char*))
end rule quoted_label_char
(/[\u{20}-@\u{5b}-_a-~]/i)
end rule quoted_label
((quoted_label_char)+)
end rule label
((/`/i (quoted_label) /`/i) | (simple_label)) <Dhall::Parser::Label>
end rule nonreserved_label
(builtin simple_label_next_char+ | !builtin label) <Dhall::Parser::NonreservedLabel>
end rule any_label
(label)
end rule double_quote_chunk
((interpolation) | (/\u{5c}/i (double_quote_escaped)) | (double_quote_char)) <Dhall::Parser::DoubleQuoteChunk>
end rule double_quote_escaped
(/["\u{24}\/\u{5c}bfnrt]/ | ("u" (unicode_escape))) <Dhall::Parser::DoubleQuoteEscaped>
end rule unicode_escape
(((hexdig) 4*4) | (/\u{7b}/i ((hexdig)+) /\u{7d}/i))
end rule double_quote_char
(/[\u{20}!\u{23}-@\u{5b}\u{5d}-\u{7f}]/i | (valid_non_ascii))
end rule double_quote_literal
(/"/i ((double_quote_chunk)*) /"/i) <Dhall::Parser::DoubleQuoteLiteral>
end rule single_quote_continue
(single_quote_char+ single_quote_continue | interpolation single_quote_continue | escaped_quote_pair single_quote_continue | escaped_interpolation single_quote_continue | "''") <Dhall::Parser::SingleQuoteContinue>
end rule escaped_quote_pair
(`'''`) <Dhall::Parser::EscapedQuotePair>
end rule escaped_interpolation
(/(?:''(?:\u{24}))(?:\u{7b})/i) <Dhall::Parser::EscapedInterpolation>
end rule single_quote_char
!("${" | "''") (/[\u{20}-@\u{5b}-\u{7f}]/i | (valid_non_ascii) | (tab) | (end_of_line))
end rule single_quote_literal
(`''` (end_of_line) (single_quote_continue)) <Dhall::Parser::SingleQuoteLiteral>
end rule interpolation
(/(?:\u{24})(?:\u{7b})/i (complete_expression) /\u{7d}/i) <Dhall::Parser::Interpolation>
end rule text_literal
((double_quote_literal) | (single_quote_literal))
end rule if
("if")
end rule then
("then")
end rule else
("else")
end rule let
("let")
end rule in
("in")
end rule as
("as")
end rule using
("using")
end rule merge
("merge")
end rule missing
("missing") <Dhall::Parser::Missing>
end rule infinity
("Infinity")
end rule nan
("NaN") <Dhall::Parser::Nan>
end rule some
("Some")
end rule tomap
("toMap")
end rule assert
("assert")
end rule keyword
((if) | (then) | (else) | (let) | (in) | (using) | (missing) | (as) | (infinity) | (nan) | (merge) | (some) | (tomap))
end rule builtin
((natural_fold) | (natural_build) | (natural_iszero) | (natural_even) | (natural_odd) | (natural_tointeger) | (natural_show) | (integer_todouble) | (integer_show) | (natural_subtract) | (double_show) | (list_build) | (list_fold) | (list_length) | (list_head) | (list_last) | (list_indexed) | (list_reverse) | (optional_fold) | (optional_build) | (text_show) | (bool) | (true) | (false) | (optional) | (none) | (natural) | (integer) | (double) | (text) | (list) | (type) | (kind) | (sort)) <Dhall::Parser::Builtin>
end rule optional
("Optional")
end rule text
("Text")
end rule list
("List")
end rule location
("Location")
end rule bool
("Bool")
end rule true
("True")
end rule false
("False")
end rule none
("None")
end rule natural
("Natural")
end rule integer
("Integer")
end rule double
("Double")
end rule type
("Type")
end rule kind
("Kind")
end rule sort
("Sort")
end rule natural_fold
("Natural" /\//i "f" "o" "l" "d")
end rule natural_build
("Natural" /\//i "b" "u" "i" "l" "d")
end rule natural_iszero
("Natural" /\//i "i" "s" "Z" "e" "r" "o")
end rule natural_even
("Natural" /\//i "e" "v" "e" "n")
end rule natural_odd
("Natural" /\//i "o" "d" "d")
end rule natural_tointeger
("Natural" /\//i "t" "o" "I" "n" "t" "e" "g" "e" "r")
end rule natural_show
("Natural" /\//i "s" "h" "o" "w")
end rule natural_subtract
("Natural" /\//i "s" "u" "b" "t" "r" "a" "c" "t")
end rule integer_todouble
("Integer" /\//i "t" "o" "D" "o" "u" "b" "l" "e")
end rule integer_show
("Integer" /\//i "s" "h" "o" "w")
end rule double_show
("Double" /\//i "s" "h" "o" "w")
end rule list_build
("List" /\//i "b" "u" "i" "l" "d")
end rule list_fold
("List" /\//i "f" "o" "l" "d")
end rule list_length
("List" /\//i "l" "e" "n" "g" "t" "h")
end rule list_head
("List" /\//i "h" "e" "a" "d")
end rule list_last
("List" /\//i "l" "a" "s" "t")
end rule list_indexed
("List" /\//i "i" "n" "d" "e" "x" "e" "d")
end rule list_reverse
("List" /\//i "r" "e" "v" "e" "r" "s" "e")
end rule optional_fold
("Optional" /\//i "f" "o" "l" "d")
end rule optional_build
("Optional" /\//i "b" "u" "i" "l" "d")
end rule text_show
("Text" /\//i "s" "h" "o" "w")
end rule combine
(/\u{2227}/i | (/(?:\/)(?:\u{5c})/i))
end rule combine_types
(/\u{2a53}/i | (/(?:(?:(?:\/)(?:\/))(?:\u{5c}))(?:\u{5c})/i))
end rule equivalent
(/\u{2261}/i | (/(?:(?:=)(?:=))(?:=)/i))
end rule prefer
(/\u{2afd}/i | (/(?:\/)(?:\/)/i))
end rule lambda
(/[\u{5c}\u{3bb}]/i)
end rule forall
(/\u{2200}/i | ("forall"))
end rule arrow
(/\u{2192}/i | (/(?:\u{2d})(?:>)/i))
end rule exponent
(`e` (/[\u{2b}\u{2d}]/i?) ((digit)+))
end rule numeric_double_literal
((/[\u{2b}\u{2d}]/i?) ((digit)+) ((/\u{2e}/i ((digit)+) ((exponent)?)) | (exponent))) <Dhall::Parser::NumericDoubleLiteral>
end rule minus_infinity_literal
(/\u{2d}/i (infinity)) <Dhall::Parser::MinusInfinityLiteral>
end rule plus_infinity_literal
(infinity) <Dhall::Parser::PlusInfinityLiteral>
end rule double_literal
((numeric_double_literal) | (minus_infinity_literal) | (plus_infinity_literal) | (nan))
end rule natural_literal
((digit)+) <Dhall::Parser::NaturalLiteral>
end rule integer_literal
(/[\u{2b}\u{2d}]/i (natural_literal)) <Dhall::Parser::IntegerLiteral>
end rule identifier
((variable) | (builtin))
end rule variable
((nonreserved_label) (((whsp) /@/i (whsp) (natural_literal))?)) <Dhall::Parser::Variable>
end rule path_character
(/[!\u{24}-'\u{2a}\u{2b}\u{2d}\u{2e}0-;=@\u{5e}-z\u{7c}~]/i)
end rule quoted_path_character
(/[\u{20}!\u{23}-\u{2e}0-@\u{5b}-\u{7f}]/i | (valid_non_ascii))
end rule unquoted_path_component
((path_character)+)
end rule quoted_path_component
((quoted_path_character)+)
end rule path_component
(/\//i ((unquoted_path_component) | (/"/i (quoted_path_component) /"/i))) <Dhall::Parser::PathComponent>
end rule path
((path_component)+) <Dhall::Parser::Path>
end rule local
((parent_path) | (here_path) | (home_path) | (absolute_path))
end rule parent_path
(/(?:\u{2e})(?:\u{2e})/i (path)) <Dhall::Parser::ParentPath>
end rule here_path
(/\u{2e}/i (path)) <Dhall::Parser::HerePath>
end rule home_path
(/~/i (path)) <Dhall::Parser::HomePath>
end rule absolute_path
(path) <Dhall::Parser::AbsolutePath>
end rule scheme
("http" ("s"?)) <Dhall::Parser::Scheme>
end rule http_raw
((scheme) /(?::(?:\/))(?:\/)/i (authority) (url_path) ((/\u{3f}/i (query))?))
end rule url_path
(((path_component) | (/\//i (segment)))*) <Dhall::Parser::UrlPath>
end rule authority
((((userinfo) /@/i)?) (host) ((`:` (port))?)) <Dhall::Parser::Authority>
end rule userinfo
(((unreserved) | (pct_encoded) | (sub_delims) | `:`)*)
end rule host
((ip_literal) | (ipv4address) | (domain))
end rule port
((digit)*)
end rule ip_literal
(/\u{5b}/i ((ipv6address) | (ipvfuture)) /\u{5d}/i)
end rule ipvfuture
(`v` ((hexdig)+) /\u{2e}/i (((unreserved) | (sub_delims) | `:`)+))
end rule ipv6address
(((((h16) `:`) 6*6) (ls32)) | (`::` (((h16) `:`) 5*5) (ls32)) | (((h16)?) `::` (((h16) `:`) 4*4) (ls32)) | ((((h16) ((`:` (h16))?))?) `::` (((h16) `:`) 3*3) (ls32)) | ((((h16) ((`:` (h16)) 0*2))?) `::` (((h16) `:`) 2*2) (ls32)) | ((((h16) ((`:` (h16)) 0*3))?) `::` (h16) `:` (ls32)) | ((((h16) ((`:` (h16)) 0*4))?) `::` (ls32)) | ((((h16) ((`:` (h16)) 0*5))?) `::` (h16)) | ((((h16) ((`:` (h16)) 0*6))?) `::`))
end rule h16
((hexdig) 1*4)
end rule ls32
(((h16) `:` (h16)) | (ipv4address))
end rule ipv4address
((dec_octet) /\u{2e}/i (dec_octet) /\u{2e}/i (dec_octet) /\u{2e}/i (dec_octet))
end rule dec_octet
((/25(?:[0-5])/i) | (/2(?:[0-4])/i (digit)) | (`1` ((digit) 2*2)) | (/[1-9]/i (digit)) | (digit))
end rule domain
((domainlabel) ((/\u{2e}/i (domainlabel))*) (/\u{2e}/i?))
end rule domainlabel
(((alphanum)+) (((/\u{2d}/i+) ((alphanum)+))*))
end rule segment
((pchar)*)
end rule pchar
((unreserved) | (pct_encoded) | (sub_delims) | /[:@]/i)
end rule query
(((pchar) | /[\/\u{3f}]/i)*)
end rule pct_encoded
(/%/i (hexdig) (hexdig))
end rule unreserved
((alphanum) | /[\u{2d}\u{2e}_~]/i)
end rule sub_delims
(/[!\u{24}&'\u{2a}\u{2b};=]/i)
end rule http
((http_raw) (((whsp) (using) (whsp1) (import_expression))?)) <Dhall::Parser::Http>
end rule env
(`env:` ((bash_environment_variable) | (/"/i (posix_environment_variable) /"/i))) <Dhall::Parser::Env>
end rule bash_environment_variable
(((alpha) | `_`) (((alphanum) | `_`)*))
end rule posix_environment_variable
((posix_environment_variable_character)+) <Dhall::Parser::PosixEnvironmentVariable>
end rule posix_environment_variable_character
((/\u{5c}/i /["\u{5c}abfnrtv]/) | /[\u{20}!\u{23}-<>-@\u{5b}\u{5d}-~]/i) <Dhall::Parser::PosixEnvironmentVariableCharacter>
end rule import_type
((missing) | (local) | (http) | (env))
end rule hash
("sha" `2` `5` `6` `:` ((hexdig) 64*64)) <Dhall::Parser::Hash>
end rule import_hashed
((import_type) (((whsp1) (hash))?)) <Dhall::Parser::ImportHashed>
end rule import
((import_hashed) (((whsp) (as) (whsp1) ((text) | (location)))?)) <Dhall::Parser::Import>
end rule expression
(((lambda) (whsp) /\u{28}/i (whsp) (nonreserved_label) (whsp) `:` (whsp1) (expression) (whsp) /\u{29}/i (whsp) (arrow) (whsp) (expression)) | ((if) (whsp1) (expression) (whsp) (then) (whsp1) (expression) (whsp) (else) (whsp1) (expression)) | (((let_binding)+) (in) (whsp1) (expression)) | ((forall) (whsp) /\u{28}/i (whsp) (nonreserved_label) (whsp) `:` (whsp1) (expression) (whsp) /\u{29}/i (whsp) (arrow) (whsp) (expression)) | ((operator_expression) (whsp) (arrow) (whsp) (expression)) | ((merge) (whsp1) (import_expression) (whsp1) (import_expression) (whsp) `:` (whsp1) (application_expression)) | (empty_list_literal) | ((tomap) (whsp1) (import_expression) (whsp) `:` (whsp1) (application_expression)) | ((assert) (whsp) `:` (whsp1) (expression)) | (annotated_expression)) <Dhall::Parser::Expression>
end rule annotated_expression
((operator_expression) (((whsp) `:` (whsp1) (expression))?)) <Dhall::Parser::AnnotatedExpression>
end rule let_binding
((let) (whsp1) (nonreserved_label) (whsp) ((`:` (whsp1) (expression) (whsp))?) /=/i (whsp) (expression) (whsp)) <Dhall::Parser::LetBinding>
end rule empty_list_literal
(/\u{5b}/i (whsp) /\u{5d}/i (whsp) `:` (whsp1) (application_expression))
end rule operator_expression
(import_alt_expression)
end rule import_alt_expression
((or_expression) (((whsp) /\u{3f}/i (whsp1) (or_expression))*)) <Dhall::Parser::ImportAltExpression>
end rule or_expression
((plus_expression) (((whsp) /(?:\u{7c})(?:\u{7c})/i (whsp) (plus_expression))*)) <Dhall::Parser::OrExpression>
end rule plus_expression
((text_append_expression) (((whsp) /\u{2b}/i (whsp1) (text_append_expression))*)) <Dhall::Parser::PlusExpression>
end rule text_append_expression
((list_append_expression) (((whsp) /(?:\u{2b})(?:\u{2b})/i (whsp) (list_append_expression))*)) <Dhall::Parser::TextAppendExpression>
end rule list_append_expression
((and_expression) (((whsp) /\u{23}/i (whsp) (and_expression))*)) <Dhall::Parser::ListAppendExpression>
end rule and_expression
((combine_expression) (((whsp) /(?:&)(?:&)/i (whsp) (combine_expression))*)) <Dhall::Parser::AndExpression>
end rule combine_expression
((prefer_expression) (((whsp) (combine) (whsp) (prefer_expression))*)) <Dhall::Parser::CombineExpression>
end rule prefer_expression
((combine_types_expression) (((whsp) (prefer) (whsp) (combine_types_expression))*)) <Dhall::Parser::PreferExpression>
end rule combine_types_expression
((times_expression) (((whsp) (combine_types) (whsp) (times_expression))*)) <Dhall::Parser::CombineTypesExpression>
end rule times_expression
((equal_expression) (((whsp) /\u{2a}/i (whsp) (equal_expression))*)) <Dhall::Parser::TimesExpression>
end rule equal_expression
((not_equal_expression) (((whsp) /(?:=)(?:=)/i (whsp) (not_equal_expression))*)) <Dhall::Parser::EqualExpression>
end rule not_equal_expression
((equivalent_expression) (((whsp) /(?:!)(?:=)/i (whsp) (equivalent_expression))*)) <Dhall::Parser::NotEqualExpression>
end rule equivalent_expression
((application_expression) (((whsp) (equivalent) (whsp) (application_expression))*)) <Dhall::Parser::EquivalentExpression>
end rule application_expression
((first_application_expression) (((whsp1) (import_expression))*)) <Dhall::Parser::ApplicationExpression>
end rule first_application_expression
(((merge) (whsp1) (import_expression) (whsp1) (import_expression)) | ((some) (whsp1) (import_expression)) | ((tomap) (whsp1) (import_expression)) | (import_expression)) <Dhall::Parser::FirstApplicationExpression>
end rule import_expression
((import) | (selector_expression))
end rule selector_expression
((primitive_expression) (((whsp) /\u{2e}/i (whsp) (selector))*)) <Dhall::Parser::SelectorExpression>
end rule selector
((any_label) | (labels) | (type_selector)) <Dhall::Parser::Selector>
end rule labels
(/\u{7b}/i (whsp) (((any_label) (whsp) ((/,/i (whsp) (any_label) (whsp))*))?) /\u{7d}/i)
end rule type_selector
(/\u{28}/i (whsp) (expression) (whsp) /\u{29}/i)
end rule primitive_expression
((double_literal) | (natural_literal) | (integer_literal) | (text_literal) | (/\u{7b}/i (whsp) (record_type_or_literal) (whsp) /\u{7d}/i) | (/</i (whsp) (union_type) (whsp) />/i) | (non_empty_list_literal) | (identifier) | (/\u{28}/i (complete_expression) /\u{29}/i)) <Dhall::Parser::PrimitiveExpression>
end rule record_type_or_literal
((empty_record_literal) | (non_empty_record_type_or_literal) | (empty_record_type))
end rule empty_record_literal
(/=/i) <Dhall::Parser::EmptyRecordLiteral>
end rule empty_record_type
("") <Dhall::Parser::EmptyRecordType>
end rule non_empty_record_type_or_literal
((any_label) (whsp) ((non_empty_record_literal) | (non_empty_record_type))) <Dhall::Parser::NonEmptyRecordTypeOrLiteral>
end rule non_empty_record_type
(`:` (whsp1) (expression) (((whsp) /,/i (whsp) (record_type_entry))*)) <Dhall::Parser::NonEmptyRecordType>
end rule record_type_entry
((any_label) (whsp) `:` (whsp1) (expression)) <Dhall::Parser::RecordTypeEntry>
end rule non_empty_record_literal
(/=/i (whsp) (expression) (((whsp) /,/i (whsp) (record_literal_entry))*)) <Dhall::Parser::NonEmptyRecordLiteral>
end rule record_literal_entry
((any_label) (whsp) /=/i (whsp) (expression)) <Dhall::Parser::RecordLiteralEntry>
end rule union_type
((non_empty_union_type) | (empty_union_type))
end rule empty_union_type
("") <Dhall::Parser::EmptyUnionType>
end rule non_empty_union_type
((union_type_entry) (((whsp) /\u{7c}/i (whsp) (union_type_entry))*)) <Dhall::Parser::NonEmptyUnionType>
end rule union_type_entry
((any_label) (((whsp) `:` (whsp1) (expression))?)) <Dhall::Parser::UnionTypeEntry>
end rule non_empty_list_literal
(/\u{5b}/i (whsp) (expression) (whsp) ((/,/i (whsp) (expression) (whsp))*) /\u{5d}/i) <Dhall::Parser::NonEmptyListLiteral>
end rule complete_expression
((whsp) (expression) (whsp)) <Dhall::Parser::CompleteExpression>
end rule bit
(/[01]/i)
end rule char
(/[\u{01}-@\u{5b}-\u{7f}]/i)
end rule cr
(/\r/i)
end rule crlf
((cr) (lf))
end rule ctl
(/[\u{00}-\u{1f}\u{7f}]/i)
end rule dquote
(/"/i)
end rule htab
(/\t/i)
end rule lf
(/\n/i)
end rule lwsp
(((wsp) | ((crlf) (wsp)))*)
end rule octet
(/[\u{00}-@\u{5b}-\u{ff}]/i)
end rule sp
(/\u{20}/i)
end rule vchar
(/[!-@\u{5b}-~]/i)
end rule wsp
((sp) | (htab))
end end