typofix which broke the parser

This commit is contained in:
Leon van Kammen 2023-07-03 17:06:16 +02:00
parent e6518c9c66
commit e6d4bc70aa
9 changed files with 17 additions and 14 deletions

View file

@ -252,12 +252,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {

4
dist/xrfragment.js vendored
View file

@ -252,12 +252,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {

4
dist/xrfragment.lua vendored
View file

@ -1614,12 +1614,12 @@ __xrfragment_Parser.parse = function(key,value,store)
local v = __xrfragment_XRF.new(key, ret); local v = __xrfragment_XRF.new(key, ret);
if (Frag_h[key] ~= nil) then if (Frag_h[key] ~= nil) then
if (not v:validate(value)) then if (not v:validate(value)) then
__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=79,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=82,className="xrfragment.Parser",methodName="parse"}));
do return false end; do return false end;
end; end;
store[key] = v; store[key] = v;
if (__xrfragment_Parser.debug) then if (__xrfragment_Parser.debug) then
__haxe_Log.trace(Std.string(Std.string(Std.string("") .. Std.string(key)) .. Std.string(": ")) .. Std.string(v.string), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=83,className="xrfragment.Parser",methodName="parse"})); __haxe_Log.trace(Std.string(Std.string(Std.string("") .. Std.string(key)) .. Std.string(": ")) .. Std.string(v.string), _hx_o({__fields__={fileName=true,lineNumber=true,className=true,methodName=true},fileName="src/xrfragment/Parser.hx",lineNumber=86,className="xrfragment.Parser",methodName="parse"}));
end; end;
else else
if (__lua_Boot.__instanceof(value, String)) then if (__lua_Boot.__instanceof(value, String)) then

View file

@ -252,12 +252,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {

View file

@ -252,12 +252,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {

View file

@ -252,12 +252,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {

2
make
View file

@ -55,6 +55,8 @@ build(){
} }
build_js(){ build_js(){
# prepend license to vanilla lib
#echo "// https://xrfragment.org\n// SPDX-License-Identifier: MPL-2.0\n$(cat dist/xrfragment.js)" > dist/xrfragment.js
# add js module # add js module
cat dist/xrfragment.js > dist/xrfragment.module.js cat dist/xrfragment.js > dist/xrfragment.module.js
echo "export default xrfragment;" >> dist/xrfragment.module.js echo "export default xrfragment;" >> dist/xrfragment.module.js

View file

@ -97,6 +97,7 @@ class Query {
if( str.indexOf("<") != -1 ) oper = "<"; // 1. then scan for `<` operator if( str.indexOf("<") != -1 ) oper = "<"; // 1. then scan for `<` operator
if( str.indexOf(">=") != -1 ) oper = ">="; // 1. then scan for `>=` operator if( str.indexOf(">=") != -1 ) oper = ">="; // 1. then scan for `>=` operator
if( str.indexOf("<=") != -1 ) oper = "<="; // 1. then scan for `<=` operator if( str.indexOf("<=") != -1 ) oper = "<="; // 1. then scan for `<=` operator
if( isExclude.match(k) ){
oper = "!="; oper = "!=";
k = k.substr(1); // 1. then strip key-operator: convert "-foo" into "foo" k = k.substr(1); // 1. then strip key-operator: convert "-foo" into "foo"
}else v = v.substr(oper.length); // 1. then strip value operator: change value ">=foo" into "foo" }else v = v.substr(oper.length); // 1. then strip value operator: change value ">=foo" into "foo"

View file

@ -366,12 +366,12 @@ xrfragment_Parser.parse = function(key,value,store) {
var v = new xrfragment_XRF(key,Frag_h[key]); var v = new xrfragment_XRF(key,Frag_h[key]);
if(Object.prototype.hasOwnProperty.call(Frag_h,key)) { if(Object.prototype.hasOwnProperty.call(Frag_h,key)) {
if(!v.validate(value)) { if(!v.validate(value)) {
console.log("src/xrfragment/Parser.hx:79:","⚠ fragment '" + key + "' has incompatible value (" + value + ")"); console.log("src/xrfragment/Parser.hx:82:","⚠ fragment '" + key + "' has incompatible value (" + value + ")");
return false; return false;
} }
store[key] = v; store[key] = v;
if(xrfragment_Parser.debug) { if(xrfragment_Parser.debug) {
console.log("src/xrfragment/Parser.hx:83:","✔ " + key + ": " + v.string); console.log("src/xrfragment/Parser.hx:86:","✔ " + key + ": " + v.string);
} }
} else { } else {
if(typeof(value) == "string") { if(typeof(value) == "string") {