mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 20:32:10 +00:00
refactor(ast, parser)!: remove NumericLiteral::new method (#6787)
This commit is contained in:
parent
aeaa27a618
commit
a1ca964560
2 changed files with 1 additions and 7 deletions
|
|
@ -10,7 +10,6 @@ use std::{
|
|||
use oxc_allocator::CloneIn;
|
||||
use oxc_regular_expression::ast::Pattern;
|
||||
use oxc_span::{cmp::ContentEq, hash::ContentHash, Atom, Span};
|
||||
use oxc_syntax::number::NumberBase;
|
||||
|
||||
use crate::ast::*;
|
||||
|
||||
|
|
@ -59,11 +58,6 @@ impl fmt::Display for NullLiteral {
|
|||
}
|
||||
|
||||
impl<'a> NumericLiteral<'a> {
|
||||
/// Create a numeric literal representing the given `value`.
|
||||
pub fn new(span: Span, value: f64, raw: &'a str, base: NumberBase) -> Self {
|
||||
Self { span, value, raw, base }
|
||||
}
|
||||
|
||||
/// port from [closure compiler](https://github.com/google/closure-compiler/blob/a4c880032fba961f7a6c06ef99daa3641810bfdd/src/com/google/javascript/jscomp/base/JSCompDoubles.java#L113)
|
||||
///
|
||||
/// <https://262.ecma-international.org/5.1/#sec-9.5>
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ impl<'a> ParserImpl<'a> {
|
|||
_ => return Err(self.unexpected()),
|
||||
};
|
||||
self.bump_any();
|
||||
Ok(NumericLiteral::new(self.end_span(span), value, src, base))
|
||||
Ok(self.ast.numeric_literal(self.end_span(span), value, src, base))
|
||||
}
|
||||
|
||||
pub(crate) fn parse_literal_bigint(&mut self) -> Result<BigIntLiteral<'a>> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue