Expressions
- Added a second parameter to the constructor for `IntegerLiteral`, this takes in the encoding of type `IntegerLiteralEncoding` Parser - Updated the `SymbolType.NUMBER_LITERAL` handling code to handle the new constructor for `IntegerLiteral`
This commit is contained in:
parent
be3b2085ad
commit
ecbaa5d4de
|
@ -1133,12 +1133,16 @@ public final class Parser
|
|||
// If floating point literal
|
||||
if(isFloatLiteral(numberLiteralStr))
|
||||
{
|
||||
// TODO: Issue #94, siiliar to below for integers
|
||||
numberLiteral = new FloatingLiteral(getCurrentToken().getToken());
|
||||
}
|
||||
// Else, then an integer literal
|
||||
else
|
||||
{
|
||||
numberLiteral = new IntegerLiteral(getCurrentToken().getToken());
|
||||
// TODO: Issue #94, we should be checking the range here
|
||||
// ... along with any explicit encoders and setting it
|
||||
// ... for now default to SIGNED_INTEGER.
|
||||
numberLiteral = new IntegerLiteral(getCurrentToken().getToken(), IntegerLiteralEncoding.SIGNED_INTEGER);
|
||||
}
|
||||
|
||||
/* Add expression to stack */
|
||||
|
|
|
@ -97,9 +97,10 @@ public final class IntegerLiteral : NumberLiteral
|
|||
{
|
||||
private IntegerLiteralEncoding encoding;
|
||||
|
||||
this(string integerLiteral)
|
||||
this(string integerLiteral, IntegerLiteralEncoding encoding)
|
||||
{
|
||||
super(integerLiteral);
|
||||
this.encoding = encoding;
|
||||
}
|
||||
|
||||
public IntegerLiteralEncoding getEncoding()
|
||||
|
|
Loading…
Reference in New Issue