Skip to content

Engine: Case statement with when/in in single ERB tag not backward compatible with ActionView #1252

Description

@joelhawksley

The following is invalid in Herb:

[error] A case statement with when/in in a single ERB tag cannot be formatted. Use separate tags for case and its conditions. (ERB_CASE_WITH_CONDITIONS_ERROR) (parser-no-errors)

***.html.erb:59:32

  →  59 │                                 <% case @foo
        │                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     60 │                                    when :bar %>

 Rule offenses:
  parser-no-errors (1 offense in 1 file)

But it is valid in Erubi.

(In this case, we compile and run this template with just ERB.new, which requires the case/when to be in a single ERB tag. But the fact stands that this is valid Erubi and thus makes Herb not backwards-compatible with this pattern.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions