started work on XOR(..)...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2019-12-27 06:11:54 +03:00
parent 83e625c2bd
commit 670ed87d70
2 changed files with 21 additions and 1 deletions

20
diff.js
View File

@ -599,6 +599,26 @@ object.Constructor('OR', Object.assign(Object.create(Pattern.prototype), {
}, },
})) }))
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// XXX XOR
var XOR =
module.XOR =
object.Constructor('XOR', Object.assign(Object.create(Pattern.prototype), {
__cmp__: function(obj, cmp, context){
/* XXX
for(var m of this.members){
if(cmp(m, obj, context)){
return true
}
}
return false
//*/
},
__init__: function(...members){
this.members = members
},
}))
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Will compare as true if all of the .members compare as true... // Will compare as true if all of the .members compare as true...
var AND = var AND =

View File

@ -14,7 +14,7 @@ var diff = require('./diff')
var { var {
ANY, ANY,
NULL, BOOL, B, NUMBER, N, STRING, S, ARRAY, L, FUNCTION, F, NULL, BOOL, B, NUMBER, N, STRING, S, ARRAY, L, FUNCTION, F,
OR, AND, NOT, OR, XOR, AND, NOT,
AT, OF, IN, AT, OF, IN,
VAR, LIKE, TEST, VAR, LIKE, TEST,
// non-pattern values... // non-pattern values...