Skip to content

Commit d6ff2db

Browse files
committed
fix: plus signs in certain contexts were missing
1 parent de7b843 commit d6ff2db

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ edition = "2018"
1212

1313
build = "bindings/rust/build.rs"
1414
include = [
15-
"common",
16-
"bindings/rust",
17-
"typescript/grammar.js",
18-
"typescript/src",
19-
"tsx/grammar.js",
20-
"tsx/src",
21-
"queries"
15+
"common",
16+
"bindings/rust",
17+
"typescript/grammar.js",
18+
"typescript/src",
19+
"tsx/grammar.js",
20+
"tsx/src",
21+
"queries",
2222
]
2323

2424
[lib]

common/define-grammar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ module.exports = function defineGrammar(dialect) {
618618
),
619619

620620
omitting_type_annotation: $ => seq('-?:', $._type),
621+
adding_type_annotation: $ => seq('+?:', $._type),
621622
opting_type_annotation: $ => seq('?:', $._type),
622623
type_annotation: $ => seq(':', $._type),
623624

@@ -933,7 +934,7 @@ module.exports = function defineGrammar(dialect) {
933934
index_signature: $ => seq(
934935
optional(
935936
seq(
936-
field("sign", optional("-")),
937+
field("sign", optional(choice("-", "+"))),
937938
'readonly'
938939
)
939940
),
@@ -953,6 +954,7 @@ module.exports = function defineGrammar(dialect) {
953954
field('type', choice(
954955
$.type_annotation,
955956
$.omitting_type_annotation,
957+
$.adding_type_annotation,
956958
$.opting_type_annotation
957959
))
958960
),

0 commit comments

Comments
 (0)