Browse Source

fixed bug in operator matching function

pull/1/head
nisstyre56 11 years ago
parent
commit
3e1c5528e1
  1. 3
      test.js
  2. 3
      tools.js

3
test.js

@ -97,6 +97,9 @@ function extendProp(pair) {
return x.length + y.length === extended.length;
}
/* Tokenizer tests */
function toolsTests() {
assert.equal(true, tools.empty([]));
assert.equal(true, qc.forAll(dictProp, arbArrayofPairs));

3
tools.js

@ -1,5 +1,4 @@
var _ = require("underscore");
var example = require("./failing.js");
function empty(xs) {
return _.size(xs) < 1;
@ -55,7 +54,7 @@ RegExp.escape= function(s) {
function operatorMatch(ops) {
ops = _.filter(ops,
function (op) {
return op.replace(/ /g,'').length > 1;
return op.length > 0;
});
var rstring = ops.sort(min).reduce(
function(acc, x) {

Loading…
Cancel
Save