Skip to content

Comments and extra lines in if...else blocks #394

Closed
@TrevorBurnham

Description

@TrevorBurnham

Here's an odd edge case: The following pointless but well-documented piece of code compiles just fine

# Set i = 1 if true
if true
  i = 1

else
  i = 2

as does this

# Set i = 1 if true
if true
  i = 1
# Otherwise, set i = 2
else
  i = 2

but this won't parse:

# Set i = 1 if true
if true
  i = 1

# Otherwise, set i = 2
else
  i = 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions