Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #805 from jstepien/fix-bang-method-call
Add a production for "expr : BANG command_call"
  • Loading branch information
alex committed Jul 13, 2013
2 parents f8507a3 + 90a2b1c commit 5bf38e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions tests/test_interpreter.py
Expand Up @@ -1912,3 +1912,9 @@ def test_rescue_superclass(self, space):
end
""")
assert space.int_w(w_res) == 0

def test_bang_method_call_without_parens(self, space):
w_res = space.execute("""
! respond_to? :asdf
""")
assert w_res is space.w_true
2 changes: 1 addition & 1 deletion topaz/parser.py
Expand Up @@ -701,7 +701,7 @@ def expr_not(self, p):

@pg.production("expr : BANG command_call")
def expr_bang_command_call(self, p):
raise NotImplementedError(p)
return self.new_call(p[1], self.new_token(p[0], "!", "!"), None)

@pg.production("expr : arg")
def expr_arg(self, p):
Expand Down

0 comments on commit 5bf38e8

Please sign in to comment.