Skip to content

Commit 0329e70

Browse files
committed
terminate operator regexp with word boundary
Like suggested in: bloomtime#1 (comment)
1 parent c3cccd0 commit 0329e70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

expression.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ function word() {
3535
}
3636

3737
function notop() {
38-
return this.match(/^NOT/i).toUpperCase();
38+
return this.match(/^NOT\b/i).toUpperCase();
3939
}
4040

4141
function negation() {
4242
return this.seq(notop, notFactor).slice(1);
4343
}
4444

4545
function conjunction() {
46-
return OPTREES[this.match(/^AND/i).toUpperCase()];
46+
return OPTREES[this.match(/^AND\b/i).toUpperCase()];
4747
}
4848

4949
function disjunction() {
50-
return OPTREES[this.match(/^OR/i).toUpperCase()];
50+
return OPTREES[this.match(/^OR\b/i).toUpperCase()];
5151
}
5252

5353
var OPTREES = {

0 commit comments

Comments
 (0)