Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Two string comparisons in same expression fails #67

goodwithgit opened this Issue · 1 comment

2 participants


I have an object defined thus:

define Value {
    id : null,
    v : null,
    constructor : function (id, value) { = id;
        this.v = value;

I'm asserting a fact like this:

s.assert(new Value("xyz", "abc"));

Then looking for it in a when clause like this:

v4 : Value =~ /xyz/ && v4.v =~ /abc/;

The above fails to trigger the rule. The following does trigger the rule:

 v4 : Value =~ /xyz/ && v4.v ==  'abc';

For some reason, two string comparisons in the same rule don't want to play nice.

@doug-martin doug-martin was assigned

After some investigation there is an issue with parsing regexps in the constraint grammar which does a greedy match on the first regexp. Im working on fixing the parser for the regexp and will have a fix soon.

@doug-martin doug-martin referenced this issue from a commit in doug-martin/nools
@doug-martin doug-martin v0.1.10
* Added ability to `import` other nools files to create composible rules files [#58](C2FO#58)
* When using `global` to require other files you can now require other files relative to the nools file
* Added uglify-js as a dependency instead of devDependency #71
* Fixed issue #61 where transpile would not properly escape `"` character.
* Fixed issue #66 and #67 where regular expression matching was too greedy.
* Fixed issue #62 where constraints with a `"` character would produce invalid javascript when `transpiling`.
* Fixed issue #69 where rules names with a `'` character in a rule would produce invalid javascript when `transpiling`.
@doug-martin doug-martin referenced this issue

v0.1.10 #63

@doug-martin doug-martin closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.