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 can’t handle non-BMP identifiers #106

Closed lucaswerkmeister closed 9 years ago

lucaswerkmeister commented 9 years ago

The formatter chokes on characters outside the Basic Multilingual Plane, that is, characters that don’t fit in one Java char. In this case, the length of the text (that is, Ceylon String.length) doesn’t match the offsets that ANTLR calculates for Token.startIndex and Token.stopIndex.

For instance:

Float 𝜑 = 90.0;

(That’s U+1D711 MATHEMATICAL ITALIC SMALL PHI. On the other hand, U+03C6 GREEK SMALL LETTER PHI works.)