Skip to content

Parser: Convert literals to static text when transforming postfix/ternaries with transform_conditionals #1608

@marcoroth

Description

@marcoroth

A future optimization could be to extract literal values directly as LiteralNodes or the proper equivalent. So that:

<%= condition ? 'yes' : 'no' %>

could become:

- <% if condition %><%= 'yes' %><% else %><%= 'no' %><% end %>
+ <% if condition %>yes<% else %>no<% end %>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions