File tree 1 file changed +23
-0
lines changed
1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ export interface JSONLiteralBase extends BaseJSONNode {
53
53
| JSONProperty
54
54
| JSONExpressionStatement
55
55
| JSONUnaryExpression
56
+ | JSONBinaryExpression
56
57
}
57
58
```
58
59
@@ -101,6 +102,7 @@ export type JSONExpression =
101
102
| JSONUnaryExpression
102
103
| ( JSONIdentifier & { name: " Infinity" | " NaN" | " undefined" } )
103
104
| JSONTemplateLiteral
105
+ | JSONBinaryExpression
104
106
` ` `
105
107
106
108
This parser can parse ` " Infinity" ` , ` " NaN" ` and ` " undefined" ` as values. But you can't use these values in actual JSON, JSONC and JSON5.
@@ -162,6 +164,27 @@ This node is [UnaryExpression](https://github.com/estree/estree/blob/master/es5.
162
164
163
165
Only ` "-" ` can be used by ` operator ` in JSON and JSONC.
164
166
167
+ ### JSONBinaryExpression
168
+
169
+ ``` ts
170
+ export interface JSONUnaryExpression extends BaseJSONNode {
171
+ type: " JSONBinaryExpression"
172
+ operator: " -" | " +" | " *" | " /" | " %" | " **"
173
+ left: JSONNumberLiteral | JSONUnaryExpression | JSONBinaryExpression
174
+ right: JSONNumberLiteral | JSONUnaryExpression | JSONBinaryExpression
175
+ parent:
176
+ | JSONArrayExpression
177
+ | JSONProperty
178
+ | JSONExpressionStatement
179
+ | JSONUnaryExpression
180
+ | JSONBinaryExpression
181
+ }
182
+ ```
183
+
184
+ This node is [ BinaryExpression] ( https://github.com/estree/estree/blob/master/es5.md#binaryexpression ) for JSON.
185
+
186
+ This parser can only parse binary expressions of static numbers. You cannot use binary expressions in actual JSON, JSONC and JSON5.
187
+
165
188
## Statements
166
189
167
190
### JSONExpressionStatement
You can’t perform that action at this time.
0 commit comments