eclipse-archived / ceylon.formatter

A formatter for the Ceylon programming language, written in Ceylon.
Apache License 2.0
14 stars 11 forks source link

Formatter crashes on [...x] subscripts #77

Closed lucaswerkmeister closed 10 years ago

lucaswerkmeister commented 10 years ago

Noticed in ceylon.ast/source_gen/ceylon/ast/ConcreteClassGenerator.ceylon.

lucaswerkmeister commented 10 years ago

Actually, there’s two bugs here.

  1. GoLeftVisitor.visitElementRange always tries to visit the lower bound, even if it doesn’t exist
  2. GoLeftVisitor doesn’t override visitIndexExpression to visit only the primary

And the bug only happens if a [...x] subscript appears in a position where it’s visited by a GoLeftVisitor, i. e. within a string template.