Add decimal parsing support (#11640)
* docs: add DecimalLiteral to AST spec * add decimal support * fix: throw invalid decimal on start * add DecimalLiteral type definitions * update parser typings * add generator support * add syntax-decimal plugin * Add syntax-decimal to babel-standalone * add syntax-decimal to missing plugin helpers * fix incorrect test macro
This commit is contained in:
@@ -11,6 +11,7 @@ These are the core @babel/parser (babylon) AST node types.
|
||||
- [BooleanLiteral](#booleanliteral)
|
||||
- [NumericLiteral](#numericliteral)
|
||||
- [BigIntLiteral](#bigintliteral)
|
||||
- [DecimalLiteral](#decimalliteral)
|
||||
- [Programs](#programs)
|
||||
- [Functions](#functions)
|
||||
- [Statements](#statements)
|
||||
@@ -253,6 +254,17 @@ interface BigIntLiteral <: Literal {
|
||||
|
||||
The `value` property is the string representation of the `BigInt` value. It doesn't include the suffix `n`.
|
||||
|
||||
## DecimalLiteral
|
||||
|
||||
```js
|
||||
interface DecimalLiteral <: Literal {
|
||||
type: "DecimalLiteral";
|
||||
value: string;
|
||||
}
|
||||
```
|
||||
|
||||
The `value` property is the string representation of the `BigDecimal` value. It doesn't include the suffix `m`.
|
||||
|
||||
# Programs
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user