Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -93,6 +93,12 @@ public class LAssembler{
|
|||||||
if(symbol.startsWith("0x")) return Strings.parseLong(symbol, 16, 2, symbol.length(), invalidNum);
|
if(symbol.startsWith("0x")) return Strings.parseLong(symbol, 16, 2, symbol.length(), invalidNum);
|
||||||
if(symbol.startsWith("+0x")) return Strings.parseLong(symbol, 16, 3, symbol.length(), invalidNum);
|
if(symbol.startsWith("+0x")) return Strings.parseLong(symbol, 16, 3, symbol.length(), invalidNum);
|
||||||
if(symbol.startsWith("-0x")) return -Strings.parseLong(symbol, 16, 3, symbol.length(), invalidNum);//FIXME: breaks with Long.MIN_VALUE
|
if(symbol.startsWith("-0x")) return -Strings.parseLong(symbol, 16, 3, symbol.length(), invalidNum);//FIXME: breaks with Long.MIN_VALUE
|
||||||
|
if(symbol.startsWith("%[") && symbol.endsWith("]") && symbol.length() > 3){
|
||||||
|
double color = parseNamedColor(symbol);
|
||||||
|
if(color != -1d){
|
||||||
|
return color;
|
||||||
|
}
|
||||||
|
}
|
||||||
if(symbol.startsWith("%") && (symbol.length() == 7 || symbol.length() == 9)) return parseColor(symbol);
|
if(symbol.startsWith("%") && (symbol.length() == 7 || symbol.length() == 9)) return parseColor(symbol);
|
||||||
|
|
||||||
return Strings.parseDouble(symbol, invalidNum);
|
return Strings.parseDouble(symbol, invalidNum);
|
||||||
@@ -108,6 +114,12 @@ public class LAssembler{
|
|||||||
return Color.toDoubleBits(r, g, b, a);
|
return Color.toDoubleBits(r, g, b, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double parseNamedColor(String symbol){
|
||||||
|
Color color = Colors.get(symbol.substring(2, symbol.length() - 1));
|
||||||
|
|
||||||
|
return color == null ? -1d : color.toDoubleBits();
|
||||||
|
}
|
||||||
|
|
||||||
/** Adds a constant value by name. */
|
/** Adds a constant value by name. */
|
||||||
public LVar putConst(String name, Object value){
|
public LVar putConst(String name, Object value){
|
||||||
LVar var = putVar(name);
|
LVar var = putVar(name);
|
||||||
|
|||||||
Reference in New Issue
Block a user