add failing test

pull/625/head^2
Nikolaj Sidorenco 2024-04-17 20:18:49 +07:00
parent 098d1b2a90
commit 4126b6c1ab
No known key found for this signature in database
5 changed files with 235210 additions and 234734 deletions

@ -1,6 +1,2 @@
let x =
let ys = [1;2]
ys[
let x = 1
x
]
match x with | Some x -> | None -> 1

@ -72,6 +72,7 @@ module.exports = grammar({
conflicts: $ => [
[$.long_identifier, $._identifier_or_op],
[$.type_argument, $.static_type_argument],
[$.file],
],
word: $ => $.identifier,
@ -84,7 +85,7 @@ module.exports = grammar({
$._object_expression_inner,
$._record_type_defn_inner,
$._union_type_defn_inner,
$._then_expression
$._then_expression,
],
supertypes: $ => [$._module_elem, $._pattern, $._expression, $._type_defn_body],
@ -95,11 +96,14 @@ module.exports = grammar({
//
file: $ =>
optional(
choice(
$.named_module,
$.namespace,
repeat1($._module_elem),
)
seq(
repeat($.compiler_directive_decl),
choice(
$.named_module,
repeat1($.namespace),
repeat1($._module_elem),
),
),
),
namespace: $ =>

40
src/grammar.json generated

@ -6,22 +6,37 @@
"type": "CHOICE",
"members": [
{
"type": "CHOICE",
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "named_module"
},
{
"type": "SYMBOL",
"name": "namespace"
},
{
"type": "REPEAT1",
"type": "REPEAT",
"content": {
"type": "SYMBOL",
"name": "_module_elem"
"name": "compiler_directive_decl"
}
},
{
"type": "CHOICE",
"members": [
{
"type": "SYMBOL",
"name": "named_module"
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "namespace"
}
},
{
"type": "REPEAT1",
"content": {
"type": "SYMBOL",
"name": "_module_elem"
}
}
]
}
]
},
@ -7721,6 +7736,9 @@
[
"type_argument",
"static_type_argument"
],
[
"file"
]
],
"precedences": [],

469833
src/parser.c generated

File diff suppressed because it is too large Load Diff

@ -1688,3 +1688,52 @@ let test =
(unit))
(const
(unit))))))
================================================================================
match expression one-line
:skip
================================================================================
let test =
match x with | Some x -> x | None -> 1
--------------------------------------------------------------------------------
================================================================================
match expression multi-line
================================================================================
let test =
match x with
| Some x -> x
| None -> 1
--------------------------------------------------------------------------------
(file
(value_declaration
(function_or_value_defn
(value_declaration_left
(identifier_pattern
(long_identifier
(identifier))))
(match_expression
(long_identifier_or_op
(long_identifier
(identifier)))
(rules
(rule
(identifier_pattern
(long_identifier
(identifier))
(long_identifier
(identifier)))
(long_identifier_or_op
(long_identifier
(identifier))))
(rule
(identifier_pattern
(long_identifier
(identifier)))
(const
(int))))))))