anchor.diff:          | Exponent {$type=DecimalLiteral;}
           |
           ) (
  -            UnitSpecifier {if($type == DecimalLiteral) {$type=UnitDecimalLiteral;} else {$type=UnitLiteral;}}
  +            UnitSpecifier {$type = unitType($type);}
           |
           )
       ;
   
   StringLiteral
       :  ('"' 
  -        ( ({!(input.LA(1) == '#' && input.LA(2) == '{')}?=> (EscapeSequence | ~('\\'|'"')))* ) 
  +        ( ({!lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|'"')))* ) 
           (
               '#{' {startInterpolation(); }
           |   '"'))
       |  ('#[' 
  -        ( ({!(input.LA(1) == '#' && input.LA(2) == '{')}?=> (EscapeSequence | ~('\\'|']')))* ) 
  +        ( ({!lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|']')))* ) 
           (
               '#{' {startAltInterpolation(); }
           |   ']'))
  -    | {isInterpolating()}?=> ('}' ( ({!(input.LA(1) == '#' && input.LA(2) == '{')}?=> (EscapeSequence | ~('\\'|'"')))* ) 
  +    | {isInterpolating()}?=> ('}' ( ({!lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|'"')))* ) 
           (
               '#{' {startInterpolation(); }
           |   '"'  {endInterpolation(); }))
  -    | {isAltInterpolating()}?=> ('}' ( ({!(input.LA(1) == '#' && input.LA(2) == '{')}?=> (EscapeSequence | ~('\\'|']')))* ) 
  +    | {isAltInterpolating()}?=> ('}' ( ({!lookingAtInterpolation()}?=> (EscapeSequence | ~('\\'|']')))* ) 
           (
               '#{' {startAltInterpolation(); }
           |   ']'  {endAltInterpolation(); }))
  
positive.code:             {isNum(input.LA(2))}?=> (FloatWithLeadingDot) {$type=DecimalLiteral;}
          |
          ) (
              UnitSpecifier {if($type == DecimalLiteral) {$type=UnitDecimalLiteral;} else {$type=UnitLiteral;}}
          |
          )
      |   NonZeroDecimal (
  
negative.code: 
    public boolean isNum(int c) {
        return c>='0' && c<='9';
    }
  
    public int unitType(int type) {
        if(type == DecimalLiteral) {
            return UnitDecimalLiteral;
        } else {
            return UnitLiteral;
        }
    }
  
    public boolean lookingAtInterpolation() {
        return input.LA(1) == '#' && input.LA(2) == '{';
    }
  }
  
  