Parse units on numeric literals and keep them in the AST (#5061)
* Code changes Signed-off-by: Nick Cameron <nrc@ncameron.org> * test changes Signed-off-by: Nick Cameron <nrc@ncameron.org> * Frontend changes Signed-off-by: Nick Cameron <nrc@ncameron.org> * Refactor asNum Co-authored-by: Jonathan Tran <jonnytran@gmail.com> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org> Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
This commit is contained in:
@ -24,7 +24,10 @@ describe('testing AST', () => {
|
||||
type: 'Literal',
|
||||
start: 0,
|
||||
end: 1,
|
||||
value: 5,
|
||||
value: {
|
||||
suffix: 'None',
|
||||
value: 5,
|
||||
},
|
||||
raw: '5',
|
||||
},
|
||||
operator: '+',
|
||||
@ -32,7 +35,10 @@ describe('testing AST', () => {
|
||||
type: 'Literal',
|
||||
start: 3,
|
||||
end: 4,
|
||||
value: 6,
|
||||
value: {
|
||||
suffix: 'None',
|
||||
value: 6,
|
||||
},
|
||||
raw: '6',
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user