The RakuAST::IntLiteral class represents a literal integer value (such
as `42`).
Object introspection
RakuAST::IntLiteral objects are typically created when parsing Raku
Programming Language code. So most developers will only need to know
how to introspect the objects created.
These introspection methods are available (in alphabetical order):
value
say $literal.value;
The value method returns the value it is representing.
Object creation
There is one way to create a RakuAST::IntLiteral object directly
(rather than having RakuAST::Literal.from-value figure it out):
new
my $literal = RakuAST::IntLiteral.new(42);
say $literal.^name; # RakuAST::IntLiteral
Creates a RakuAST::IntLiteral object from the given value.
Assumes the value is really an integer, does not do any sanity
checks.