Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

white space significant in nools rule constraints, when it shouldn't be. source of easy errors. #157

Closed
williamwsmith opened this issue Sep 30, 2015 · 2 comments · Fixed by #204
Assignees
Labels
Milestone

Comments

@williamwsmith
Copy link

This constraint compiles/executes:

dw : DimensionalWeight dw.value != null && (dw.valid == null || dw.valid == false);

While this one does not:

dw : DimensionalWeight dw.value !=null && (dw.valid == null || dw.valid == false);

The white space between the "!=" and the "null" has been removed.

@DevSide
Copy link
Collaborator

DevSide commented Oct 5, 2016

I looks like this is a specific bug with null and the whitespace.
You can also use isNull(dw.value)

var indexOf = definedFuncs.indexOf; var hasOwnProperty = Object.prototype.hasOwnProperty;return function matcher0(fact, hash){var dw = hash.dw;var null = fact.null; return !!(dw['value'] == null);}

SyntaxError: Unexpected token null
    at exports.toJs (nools/lib/constraintMatcher.js:441:13)
    at Object.exports.getMatcher (nools/lib/constraintMatcher.js:448:12)

@DevSide
Copy link
Collaborator

DevSide commented Oct 6, 2016

PR #204

@DevSide DevSide self-assigned this Oct 6, 2016
@DevSide DevSide closed this as completed Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants