Skip to content

Commit

Permalink
more tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ilevyor committed Mar 22, 2024
1 parent 89d057b commit 07c9415
Show file tree
Hide file tree
Showing 26 changed files with 786,427 additions and 760,862 deletions.
20 changes: 15 additions & 5 deletions crates/core/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9786,12 +9786,15 @@ fn js_automatically_adds_comma() {

#[test]
fn js_multiple_insert_with_trailing_comma() {
run_test_match({
TestArg {
run_test_expected({
TestArgExpected {
pattern: r#"
|language js(js_do_not_use)
|language js
|
|`($x) => { $_ }`
|`($x) => { $_ }` where {
| $x += `a`,
| $x += `b`,
|}
|"#
.trim_margin()
.unwrap(),
Expand All @@ -9801,7 +9804,14 @@ fn js_multiple_insert_with_trailing_comma() {
|};
|"#
.trim_margin()
.unwrap()
.unwrap(),
expected: r#"
|var times = (x, y, z, a, b,) => {
| return x * y * z;
|};
|"#
.trim_margin()
.unwrap(),
}
})
.unwrap();
Expand Down
Binary file modified crates/wasm-bindings/wasm_parsers/tree-sitter-javascript.wasm
Binary file not shown.
Binary file modified crates/wasm-bindings/wasm_parsers/tree-sitter-tsx.wasm
Binary file not shown.
Binary file modified crates/wasm-bindings/wasm_parsers/tree-sitter-typescript.wasm
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -1298,9 +1298,9 @@ module.exports = grammar({
_formal_parameters: $ => seq(
field('parenthesis', alias('(', $.l_parenthesis)),
optional(seq(field('parameters',
commaSep1($._formal_parameter),
commaSep1($._formal_parameter)),
optional(','),
))),
)),
field('parenthesis', alias(')', $.r_parenthesis)),
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,33 +769,37 @@
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "var"
"type": "SYMBOL",
"name": "var"
},
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "variable_declarator"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "variable_declarator"
}
]
"type": "FIELD",
"name": "declarations",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "variable_declarator"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "variable_declarator"
}
]
}
}
}
]
]
}
},
{
"type": "SYMBOL",
Expand Down Expand Up @@ -6720,8 +6724,17 @@
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": "("
"type": "FIELD",
"name": "parenthesis",
"content": {
"type": "ALIAS",
"content": {
"type": "STRING",
"value": "("
},
"named": true,
"value": "l_parenthesis"
}
},
{
"type": "CHOICE",
Expand All @@ -6730,29 +6743,33 @@
"type": "SEQ",
"members": [
{
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_formal_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_formal_parameter"
}
]
"type": "FIELD",
"name": "parameters",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_formal_parameter"
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "SYMBOL",
"name": "_formal_parameter"
}
]
}
}
}
]
]
}
},
{
"type": "CHOICE",
Expand All @@ -6774,8 +6791,17 @@
]
},
{
"type": "STRING",
"value": ")"
"type": "FIELD",
"name": "parenthesis",
"content": {
"type": "ALIAS",
"content": {
"type": "STRING",
"value": ")"
},
"named": true,
"value": "r_parenthesis"
}
}
]
},
Expand Down
Loading

0 comments on commit 07c9415

Please sign in to comment.