[RubySpec] [1.9] Parser appears to treat "not()" with incorrect precedence --------------------------------------------------------------------------
Key: JRUBY-5250 URL: http://jira.codehaus.org/browse/JRUBY-5250 Project: JRuby Issue Type: Bug Components: Parser Affects Versions: JRuby 1.6 Reporter: Charles Oliver Nutter Assignee: Thomas E Enebo Affects "not" specs in RubySpec. {noformat} 1) not() returns false if the argument is true FAILED Expected "true" to equal "false" /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:12:in `(root)' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyEnumerable.java:1264:in `all_p' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:1:in `(root)' org/jruby/RubyKernel.java:1050:in `require19' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:23:in `language_version' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:33:in `(root)' org/jruby/RubyKernel.java:1076:in `load19' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:56:in `files' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyArray.java:1655:in `each' 2) not() returns true if the argument is false FAILED Expected "false" to equal "true" /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:16:in `(root)' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyEnumerable.java:1264:in `all_p' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:1:in `(root)' org/jruby/RubyKernel.java:1050:in `require19' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:23:in `language_version' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:33:in `(root)' org/jruby/RubyKernel.java:1076:in `load19' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:56:in `files' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyArray.java:1655:in `each' 3) not() returns true if the argument is nil FAILED Expected "false" to equal "true" /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:20:in `(root)' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyEnumerable.java:1264:in `all_p' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:1:in `(root)' org/jruby/RubyKernel.java:1050:in `require19' /Users/headius/projects/jruby/spec/ruby/language/versions/not_1.9.rb:23:in `language_version' org/jruby/RubyArray.java:1655:in `each' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:33:in `(root)' org/jruby/RubyKernel.java:1076:in `load19' /Users/headius/projects/jruby/spec/ruby/language/not_spec.rb:56:in `files' org/jruby/RubyBasicObject.java:1682:in `instance_eval19' org/jruby/RubyArray.java:1655:in `each' {noformat} Parse trees for two forms: {noformat} ~/projects/jruby ➔ jruby --1.9 -S ast -e 'not(true).inspect.should == "false"' AST: RootNode 0 NewlineNode 0 CallNoArgNode:! 0 CallOneArgNode:== 0 CallNoArgNode:should 0 CallNoArgNode:inspect 0 NewlineNode 0 TrueNode:true 0 ArrayNode 0 StrNode 0 ~/projects/jruby ➔ jruby --1.9 -S ast -e '(not(true)).inspect.should == "false"' AST: RootNode 0 NewlineNode 0 CallOneArgNode:== 0 CallNoArgNode:should 0 CallNoArgNode:inspect 0 NewlineNode 0 CallNoArgNode:! 0 NewlineNode 0 TrueNode:true 0 ArrayNode 0 StrNode 0 {noformat} -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email