Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax: allow empty case without when #6367

Merged

Commits on Jul 11, 2018

  1. Syntax: allow empty case without when

    The following is no longer a syntax error:
    ```
    case foo # expands to `foo`
    end
    
    case foo # expands to `foo; bar`
    else
      bar
    end
    ```
    
    While an empty case doesn't make much sense in regular code, it is
    useful for automatically generated `when` branches (for example in a macro)
    and avoids extra effort to prevent empty case nodes.
    
    This also fixes a parsing error for `case` without condition (`case;
    when true; end`).
    straight-shoota committed Jul 11, 2018
    Configuration menu
    Copy the full SHA
    e14ec7a View commit details
    Browse the repository at this point in the history