NumberLiteral class final
A numeric literal: { 5 }, { 3.14 }, { -7 }.
Stored as the original source text (value) plus the digit count after
the decimal point (precision). Keeping the source string avoids
floating-point rounding during parse and lets formatters honor the
author's chosen precision.
- Inheritance
-
- Object
- FluentNode
- SyntaxNode
- Literal
- NumberLiteral
Constructors
- NumberLiteral(String value, int precision, {Span? span})
-
Wraps the source
valueand its fractionprecision.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- precision → int
-
Fraction digits written in the source (
3.14→ 2).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- span → Span?
-
Source range this node covers; null when spans were off.
final
- value → String
-
The number exactly as written in the FTL source.
final
Methods
-
clone(
) → NumberLiteral -
Deep clone of this node.
override
-
equals(
FluentNode other, {bool ignoreSpans = true}) → bool -
Structural equality.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDouble(
) → double -
Numeric value as a Dart
double(orint, callers can downcast). -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited