Slight optimization
This commit is contained in:
+1
-1
@@ -62,7 +62,7 @@ enum Error_
|
||||
EInvalidEscape( s : String );
|
||||
}
|
||||
|
||||
enum abstract ErrorMessage(Int) from Int to Int {
|
||||
enum abstract ErrorMessage(Expr.UInt8) from Expr.UInt8 to Expr.UInt8 {
|
||||
final INVALID_CHAR_CODE_MULTI;
|
||||
final FROM_CHAR_CODE_NON_INT;
|
||||
final EMPTY_INTERPOLATION;
|
||||
|
||||
+25
-14
@@ -21,6 +21,16 @@
|
||||
*/
|
||||
package hscript;
|
||||
|
||||
typedef Int8 = #if cpp cpp.Int8 #else Int #end;
|
||||
typedef Int16 = #if cpp cpp.Int16 #else Int #end;
|
||||
typedef Int32 = #if cpp cpp.Int32 #else Int #end;
|
||||
typedef Int64 = #if cpp cpp.Int64 #else Int #end;
|
||||
|
||||
typedef UInt8 = #if cpp cpp.UInt8 #else Int #end;
|
||||
typedef UInt16 = #if cpp cpp.UInt16 #else Int #end;
|
||||
typedef UInt32 = #if cpp cpp.UInt32 #else Int #end;
|
||||
typedef UInt64 = #if cpp cpp.UInt64 #else Int #end;
|
||||
|
||||
enum Const {
|
||||
CInt( v : Int );
|
||||
CFloat( f : Float );
|
||||
@@ -30,12 +40,13 @@ enum Const {
|
||||
#end
|
||||
}
|
||||
|
||||
enum MapType {
|
||||
IntMap;
|
||||
StringMap;
|
||||
EnumMap;
|
||||
ObjectMap;
|
||||
UnknownMap;
|
||||
enum abstract MapType(UInt8) {
|
||||
var Null;
|
||||
var IntMap;
|
||||
var StringMap;
|
||||
var EnumMap;
|
||||
var ObjectMap;
|
||||
var UnknownMap;
|
||||
}
|
||||
|
||||
typedef Error = hscript.Error.Error_;
|
||||
@@ -224,7 +235,7 @@ enum Binop {
|
||||
OpNullCoal;
|
||||
}
|
||||
|
||||
enum abstract Unop(Int) {
|
||||
enum abstract Unop(UInt8) {
|
||||
/**
|
||||
`++`
|
||||
**/
|
||||
@@ -352,13 +363,13 @@ typedef FieldDecl = {
|
||||
var access : Array<FieldAccess>;
|
||||
}
|
||||
|
||||
enum FieldAccess {
|
||||
APublic;
|
||||
APrivate;
|
||||
AInline;
|
||||
AOverride;
|
||||
AStatic;
|
||||
AMacro;
|
||||
enum abstract FieldAccess(UInt8) {
|
||||
var APublic;
|
||||
var APrivate;
|
||||
var AInline;
|
||||
var AOverride;
|
||||
var AStatic;
|
||||
var AMacro;
|
||||
}
|
||||
|
||||
enum FieldKind {
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ private enum Stop {
|
||||
SReturn;
|
||||
}
|
||||
|
||||
enum abstract ScriptObjectType(Int) {
|
||||
enum abstract ScriptObjectType(UInt8) {
|
||||
var SClass;
|
||||
var SObject;
|
||||
var SStaticClass;
|
||||
|
||||
+2
-2
@@ -674,14 +674,14 @@ class Parser {
|
||||
|
||||
var t = b2i(isKeyString) + b2i(isKeyInt) + b2i(isKeyObject) + b2i(isKeyEnum);
|
||||
|
||||
var type:MapType = null;
|
||||
var type:MapType = Null;
|
||||
if(t != 1) type = UnknownMap;
|
||||
else if(isKeyInt) type = IntMap;
|
||||
else if(isKeyString) type = StringMap;
|
||||
else if(isKeyEnum) type = EnumMap;
|
||||
else if(isKeyObject) type = ObjectMap;
|
||||
|
||||
if(type == null)
|
||||
if(type == Null)
|
||||
error(EPreset(UNKNOWN_MAP_TYPE), p1, p1);
|
||||
|
||||
return parseExprNext(mk(EMapDecl(type, keys, values), p1));
|
||||
|
||||
@@ -314,6 +314,7 @@ class Printer {
|
||||
case EnumMap: add("EnumValue");
|
||||
case IntMap: add("Int");
|
||||
case UnknownMap: add("?");
|
||||
case Null: add("Null");
|
||||
}
|
||||
add(", Dynamic>");
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user