Project

General

Profile

Bug #5214

"not (true)" should not warn "(...) interpreted as grouped expression"

Added by drbrain (Eric Hodel) almost 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.9.3dev (2011-08-21 revision 33020) [x86_64-darwin11.1.0]
Backport:
[ruby-core:39050]

Description

If you have a space between "not" and "(" ruby will warn.

Since it is normal to use "not" with a grouped expression ruby should not warn

The workaround is to remove the space or change to "!" instead of "not"


Related issues

Has duplicate Ruby master - Bug #6674: 1.9 parser regression: not ()Closed06/30/2012Actions

Associated revisions

Revision bbaf9b28
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 36434
Added by shugo (Shugo Maeda) almost 7 years ago

  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Revision 68a01f9c
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

Revision 36449
Added by nobu (Nobuyoshi Nakada) almost 7 years ago

test_syntax.rb: update

  • test/ruby/test_syntax.rb (test_warn_grouped_expression): update for r36434. [ruby-core:39050][Bug #5214]

History

Updated by ko1 (Koichi Sasada) over 7 years ago

  • Assignee set to nobu (Nobuyoshi Nakada)
#2

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Open to Assigned
#3

Updated by shugo (Shugo Maeda) almost 7 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r36434.
Eric, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • parse.y (primary): allow an empty grouped expression as the
    operand of the not operator (e.g., not ()).
    [ruby-core:45976] [Bug #6674]

  • parse.y (parser_yylex): show no warning for a grouped expression
    as the operand of the not operator (e.g., not (a)) or as an
    argument of a method call without parentheses (e.g., foo (a)).
    [ruby-core:39050] [Bug #5214]

Also available in: Atom PDF