usethesource / rascal

The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
http://www.rascal-mpl.org
Other
406 stars 78 forks source link

Concrete patterns with newlines have an off by one error for keyword highlighting at the start of a newline #846

Open DavyLandman opened 9 years ago

DavyLandman commented 9 years ago
import lang::java::\syntax::Java15;

void main(start[CompilationUnit] cu) {
    if (/(Stm)`if (<Expr _>)
        '   <Stm _> 
        'else 
        '   <Stm _>` := cu) {
        ;
    }
    if (/(Stm)`if (<Expr _>)
        '   <Stm _> 
        ' else 
        '   <Stm _>` := cu) {
        ;
    }
}

The only textual difference is the space in front of the else.

Here is the visual difference: screen shot 2015-08-05 at 11 59 46

jurgenvinju commented 9 years ago

Could also be an ambiguity. Use the list ambiguities feature in the ide top find out? If there is ambiguity then highlighting may change depending on "else" being a keyword or not.

DavyLandman commented 9 years ago

nope, not an ambiguity.

(nothing in the ambiguity list, nor after importing the module in the console)