minor updates

This commit is contained in:
Leon van Kammen 2023-05-04 16:26:14 +02:00
parent fd5e43c0a6
commit 0ec526d9a2
8 changed files with 36 additions and 29 deletions

9
dist/xrfragment.js vendored
View File

@ -250,13 +250,13 @@ xrfragment_Parser.parse = function(key,value,resultMap) {
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
var v = new xrfragment_XRF(key,Frag_h[key]);
if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:74:","[ i ] fragment '" + key + "' has incompatible value (" + value + ")");
console.log("src/xrfragment/Parser.hx:75:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false;
}
if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:78:","✔ XR Fragment '" + key + "': '" + v.string + "'");
}
resultMap[key] = v;
} else {
console.log("src/xrfragment/Parser.hx:78:","[ i ] fragment '" + key + "' does not exist or has no type typed (yet)");
return false;
}
return true;
};
@ -564,6 +564,7 @@ String.__name__ = true;
Array.__name__ = true;
js_Boot.__toStr = ({ }).toString;
xrfragment_Parser.error = "";
xrfragment_Parser.debug = false;
xrfragment_XRF.ASSET = 1;
xrfragment_XRF.PROP_BIND = 2;
xrfragment_XRF.QUERY_OPERATOR = 4;

10
dist/xrfragment.lua vendored
View File

@ -1613,13 +1613,13 @@ __xrfragment_Parser.parse = function(key,value,resultMap)
end;
local v = __xrfragment_XRF.new(key, ret);
if (not v:validate(value)) then
__haxe_Log.trace(Std.string(Std.string(Std.string(Std.string("[ i ] fragment '") .. Std.string(key)) .. Std.string("' has incompatible value (")) .. Std.string(value)) .. Std.string(")"), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=74,className="xrfragment.Parser",methodName="parse"}));
__haxe_Log.trace(Std.string(Std.string(Std.string(Std.string(" fragment '") .. Std.string(key)) .. Std.string("' has incompatible value (")) .. Std.string(value)) .. Std.string(")"), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=75,className="xrfragment.Parser",methodName="parse"}));
do return false end;
end;
if (__xrfragment_Parser.debug) then
__haxe_Log.trace(Std.string(Std.string(Std.string(Std.string("✔ XR Fragment '") .. Std.string(key)) .. Std.string("': '")) .. Std.string(v.string)) .. Std.string("'"), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=78,className="xrfragment.Parser",methodName="parse"}));
end;
resultMap[key] = v;
else
__haxe_Log.trace(Std.string(Std.string("[ i ] fragment '") .. Std.string(key)) .. Std.string("' does not exist or has no type typed (yet)"), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=78,className="xrfragment.Parser",methodName="parse"}));
do return false end;
end;
do return true end;
end
@ -2369,6 +2369,8 @@ local _hx_static_init = function()
__xrfragment_Parser.error = "";
__xrfragment_Parser.debug = false;
__xrfragment_XRF.ASSET = 1;
__xrfragment_XRF.PROP_BIND = 2;

View File

@ -250,13 +250,13 @@ xrfragment_Parser.parse = function(key,value,resultMap) {
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
var v = new xrfragment_XRF(key,Frag_h[key]);
if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:74:","[ i ] fragment '" + key + "' has incompatible value (" + value + ")");
console.log("src/xrfragment/Parser.hx:75:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false;
}
if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:78:","✔ XR Fragment '" + key + "': '" + v.string + "'");
}
resultMap[key] = v;
} else {
console.log("src/xrfragment/Parser.hx:78:","[ i ] fragment '" + key + "' does not exist or has no type typed (yet)");
return false;
}
return true;
};
@ -564,6 +564,7 @@ String.__name__ = true;
Array.__name__ = true;
js_Boot.__toStr = ({ }).toString;
xrfragment_Parser.error = "";
xrfragment_Parser.debug = false;
xrfragment_XRF.ASSET = 1;
xrfragment_XRF.PROP_BIND = 2;
xrfragment_XRF.QUERY_OPERATOR = 4;

10
dist/xrfragment.py vendored
View File

@ -1288,7 +1288,7 @@ class HxString:
class xrfragment_Parser:
_hx_class_name = "xrfragment.Parser"
__slots__ = ()
_hx_statics = ["error", "parse"]
_hx_statics = ["error", "debug", "parse"]
@staticmethod
def parse(key,value,resultMap):
@ -1327,12 +1327,11 @@ class xrfragment_Parser:
if (key in Frag.h):
v = xrfragment_XRF(key,Frag.h.get(key,None))
if (not v.validate(value)):
print(str((((("[ i ] fragment '" + ("null" if key is None else key)) + "' has incompatible value (") + ("null" if value is None else value)) + ")")))
print(str(((((" fragment '" + ("null" if key is None else key)) + "' has incompatible value (") + ("null" if value is None else value)) + ")")))
return False
if xrfragment_Parser.debug:
print(str((((("✔ XR Fragment '" + ("null" if key is None else key)) + "': '") + HxOverrides.stringOrNull(v.string)) + "'")))
setattr(resultMap,(("_hx_" + key) if ((key in python_Boot.keywords)) else (("_hx_" + key) if (((((len(key) > 2) and ((ord(key[0]) == 95))) and ((ord(key[1]) == 95))) and ((ord(key[(len(key) - 1)]) != 95)))) else key)),v)
else:
print(str((("[ i ] fragment '" + ("null" if key is None else key)) + "' does not exist or has no type typed (yet)")))
return False
return True
@ -1650,6 +1649,7 @@ Math.PI = python_lib_Math.pi
python_Boot.keywords = set(["and", "del", "from", "not", "with", "as", "elif", "global", "or", "yield", "assert", "else", "if", "pass", "None", "break", "except", "import", "raise", "True", "class", "exec", "in", "return", "False", "continue", "finally", "is", "try", "def", "for", "lambda", "while"])
python_Boot.prefixLength = len("_hx_")
xrfragment_Parser.error = ""
xrfragment_Parser.debug = False
xrfragment_XRF.ASSET = 1
xrfragment_XRF.PROP_BIND = 2
xrfragment_XRF.QUERY_OPERATOR = 4

View File

@ -19,7 +19,7 @@
</template>
</datalist>
</div>
<a id="source" href="">source</a>
<a id="source" href="https://github.com/coderofsalvation/xrfragment/blob/main/example/threejs/sandbox/index.html#L87-L103">source</a>
<textarea style="display:none"></textarea>
<script async src="./../../assets/alpine.min.js"></script>

View File

@ -6,6 +6,7 @@ import xrfragment.XRF;
@:keep // <- avoids accidental removal by dead code elimination
class Parser {
public static var error:String = "";
public static var debug:Bool = false;
@:keep
public static function parse(key:String,value:String,resultMap:haxe.DynamicAccess<Dynamic>):Bool {
@ -71,11 +72,12 @@ class Parser {
if( Frag.exists(key) ){ // 1. check if param exist
var v:XRF = new XRF(key, Frag.get(key));
if( !v.validate(value) ){
trace("[ i ] fragment '"+key+"' has incompatible value ("+value+")");
trace(" fragment '"+key+"' has incompatible value ("+value+")");
return false;
}
if( debug ) trace(" XR Fragment '"+key+"': '"+v.string+"'");
resultMap.set(key, v );
}else{ trace("[ i ] fragment '"+key+"' does not exist or has no type typed (yet)"); return false; }
}
return true;
}

View File

@ -360,13 +360,13 @@ xrfragment_Parser.parse = function(key,value,resultMap) {
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
var v = new xrfragment_XRF(key,Frag_h[key]);
if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:74:","[ i ] fragment '" + key + "' has incompatible value (" + value + ")");
console.log("src/xrfragment/Parser.hx:75:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false;
}
if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:78:","✔ XR Fragment '" + key + "': '" + v.string + "'");
}
resultMap[key] = v;
} else {
console.log("src/xrfragment/Parser.hx:78:","[ i ] fragment '" + key + "' does not exist or has no type typed (yet)");
return false;
}
return true;
};
@ -675,6 +675,7 @@ Array.__name__ = true;
js_Boot.__toStr = ({ }).toString;
Test.errors = 0;
xrfragment_Parser.error = "";
xrfragment_Parser.debug = false;
xrfragment_XRF.ASSET = 1;
xrfragment_XRF.PROP_BIND = 2;
xrfragment_XRF.QUERY_OPERATOR = 4;

View File

@ -1402,7 +1402,7 @@ class HxString:
class xrfragment_Parser:
_hx_class_name = "xrfragment.Parser"
__slots__ = ()
_hx_statics = ["error", "parse"]
_hx_statics = ["error", "debug", "parse"]
@staticmethod
def parse(key,value,resultMap):
@ -1441,12 +1441,11 @@ class xrfragment_Parser:
if (key in Frag.h):
v = xrfragment_XRF(key,Frag.h.get(key,None))
if (not v.validate(value)):
print(str((((("[ i ] fragment '" + ("null" if key is None else key)) + "' has incompatible value (") + ("null" if value is None else value)) + ")")))
print(str(((((" fragment '" + ("null" if key is None else key)) + "' has incompatible value (") + ("null" if value is None else value)) + ")")))
return False
if xrfragment_Parser.debug:
print(str((((("✔ XR Fragment '" + ("null" if key is None else key)) + "': '") + HxOverrides.stringOrNull(v.string)) + "'")))
setattr(resultMap,(("_hx_" + key) if ((key in python_Boot.keywords)) else (("_hx_" + key) if (((((len(key) > 2) and ((ord(key[0]) == 95))) and ((ord(key[1]) == 95))) and ((ord(key[(len(key) - 1)]) != 95)))) else key)),v)
else:
print(str((("[ i ] fragment '" + ("null" if key is None else key)) + "' does not exist or has no type typed (yet)")))
return False
return True
@ -1765,6 +1764,7 @@ Test.errors = 0
python_Boot.keywords = set(["and", "del", "from", "not", "with", "as", "elif", "global", "or", "yield", "assert", "else", "if", "pass", "None", "break", "except", "import", "raise", "True", "class", "exec", "in", "return", "False", "continue", "finally", "is", "try", "def", "for", "lambda", "while"])
python_Boot.prefixLength = len("_hx_")
xrfragment_Parser.error = ""
xrfragment_Parser.debug = False
xrfragment_XRF.ASSET = 1
xrfragment_XRF.PROP_BIND = 2
xrfragment_XRF.QUERY_OPERATOR = 4