Skip to content

Commit

Permalink
Fix JRUBY-6538: 'obj !~ thing' is not the same as obj.send(:!~, thing)
Browse files Browse the repository at this point in the history
Credit goes to headius.
  • Loading branch information
BanzaiMan authored and dekellum committed Aug 3, 2012
1 parent 202a45c commit 1ef14f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/org/jruby/parser/Ruby19Parser.java
Expand Up @@ -3667,7 +3667,7 @@ public Object execute(ParserSupport support, RubyYaccLexer lexer, Object yyVal,
};
states[227] = new ParserState() {
public Object execute(ParserSupport support, RubyYaccLexer lexer, Object yyVal, Object[] yyVals, int yyTop) {
yyVal = new NotNode(support.getPosition(((Node)yyVals[-2+yyTop])), support.getMatchNode(((Node)yyVals[-2+yyTop]), ((Node)yyVals[0+yyTop])));
yyVal = support.getOperatorCallNode(((Node)yyVals[-2+yyTop]), "!~", ((Node)yyVals[0+yyTop]), lexer.getPosition());
return yyVal;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/org/jruby/parser/Ruby19Parser.y
Expand Up @@ -899,7 +899,7 @@ arg : lhs '=' arg {
*/
}
| arg tNMATCH arg {
$$ = new NotNode(support.getPosition($1), support.getMatchNode($1, $3));
$$ = support.getOperatorCallNode($1, "!~", $3, lexer.getPosition());
}
| tBANG arg {
$$ = support.getOperatorCallNode(support.getConditionNode($2), "!");
Expand Down

0 comments on commit 1ef14f1

Please sign in to comment.