Handle number parsing edgecases
This commit is contained in:
@@ -73,10 +73,10 @@ public class LAssembler{
|
|||||||
//remove spaces for non-strings
|
//remove spaces for non-strings
|
||||||
symbol = symbol.replace(' ', '_');
|
symbol = symbol.replace(' ', '_');
|
||||||
|
|
||||||
int usedInvalidNum=symbol.startsWith("-")?invalidNumPositive:invalidNumNegative;//use a positive invalid number if number is negative, else use a negative number
|
//handle edge cases of hard to detect sign(in hex or bin numbers)
|
||||||
double value = parseDouble(symbol, usedInvalidNum);
|
double value = parseDouble(symbol, invalidNumNegative);
|
||||||
|
|
||||||
if(value == usedInvalidNum){
|
if(value == invalidNumNegative && parseDouble(symbol, invalidNumPositive) == invalidNumPositive){
|
||||||
return putVar(symbol);
|
return putVar(symbol);
|
||||||
}else{
|
}else{
|
||||||
//this creates a hidden const variable with the specified value
|
//this creates a hidden const variable with the specified value
|
||||||
|
|||||||
Reference in New Issue
Block a user