anchor.diff:        ;
   
     logicalOrExpression() =>
  -       logicalAndExpression (ref(token, '||') logicalAndExpression).star()
  +        ref(logicalAndExpression) & (ref(token, '||') & ref(logicalAndExpression)).star()
         ;
   
     logicalAndExpression() =>
  -       bitwiseOrExpression (ref(token, '&&') bitwiseOrExpression).star()
  +        ref(bitwiseOrExpression) & (ref(token, '&&') & ref(bitwiseOrExpression)).star()
         ;
   
     bitwiseOrExpression() =>
  -       bitwiseXorExpression (ref(token, '|') bitwiseXorExpression).star()
  -      | SUPER (ref(token, '|') bitwiseXorExpression).plus()
  +        ref(bitwiseXorExpression) & (ref(token, '|') & ref(bitwiseXorExpression)).star()
  +      | ref(SUPER) & (ref(token, '|') & ref(bitwiseXorExpression)).plus()
         ;
   
     bitwiseXorExpression() =>
  -       bitwiseAndExpression (ref(token, '^') bitwiseAndExpression).star()
  -      | SUPER (ref(token, '^') bitwiseAndExpression).plus()
  +        ref(bitwiseAndExpression) & (ref(token, '^') & ref(bitwiseAndExpression)).star()
  +      | ref(SUPER) & (ref(token, '^') & ref(bitwiseAndExpression)).plus()
         ;
   
     bitwiseAndExpression() =>
  -       equalityExpression (ref(token, '&') equalityExpression).star()
  -      | SUPER (ref(token, '&') equalityExpression).plus()
  +        ref(equalityExpression) & (ref(token, '&') & ref(equalityExpression)).star()
  +      | ref(SUPER) & (ref(token, '&') & ref(equalityExpression)).plus()
         ;
   
     equalityExpression() =>
  -       relationalExpression (equalityOperator relationalExpression).optional()
  -      | SUPER equalityOperator relationalExpression
  +        ref(relationalExpression) & (ref(equalityOperator) & ref(relationalExpression)).optional()
  +      | ref(SUPER) & ref(equalityOperator) & ref(relationalExpression)
         ;
   
     relationalExpression() =>
  -       shiftExpression (isOperator type | relationalOperator shiftExpression).optional()
  -      | SUPER relationalOperator shiftExpression
  +        ref(shiftExpression) & (ref(isOperator) & ref(type) | ref(relationalOperator) & ref(shiftExpression)).optional()
  +      | ref(SUPER) & ref(relationalOperator) & ref(shiftExpression)
         ;
   
     isOperator() =>
  -       IS ref(token, '!').optional()
  +        ref(IS) & ref(token, '!').optional()
         ;
   
     shiftExpression() =>
  -       additiveExpression (shiftOperator additiveExpression).star()
  -      | SUPER (shiftOperator additiveExpression).plus()
  +        ref(additiveExpression) & (ref(shiftOperator) & ref(additiveExpression)).star()
  +      | ref(SUPER) & (ref(shiftOperator) & ref(additiveExpression)).plus()
         ;
   
     additiveExpression() =>
  -       multiplicativeExpression (additiveOperator multiplicativeExpression).star()
  -      | SUPER (additiveOperator multiplicativeExpression).plus()
  +        ref(multiplicativeExpression) & (ref(additiveOperator) & ref(multiplicativeExpression)).star()
  +      | ref(SUPER) & (ref(additiveOperator) & ref(multiplicativeExpression)).plus()
         ;
   
     multiplicativeExpression() =>
  -       unaryExpression (multiplicativeOperator unaryExpression).star()
  -      | SUPER (multiplicativeOperator unaryExpression).plus()
  +        ref(unaryExpression) & (ref(multiplicativeOperator) & ref(unaryExpression)).star()
  +      | ref(SUPER) & (ref(multiplicativeOperator) & ref(unaryExpression)).plus()
         ;
   
     unaryExpression() =>
  -       postfixExpression
  -      | prefixOperator unaryExpression
  -      | negateOperator SUPER
  -      | ref(token, '-') SUPER  // Invokes the NEGATE operator.
  -      | incrementOperator assignableExpression
  +        ref(postfixExpression)
  +      | ref(prefixOperator) & ref(unaryExpression)
  +      | ref(negateOperator) & ref(SUPER)
  +      | ref(token, '-') & ref(SUPER)
  +      | ref(incrementOperator) & ref(assignableExpression)
         ;
   
     postfixExpression() =>
  -       assignableExpression postfixOperator
  -      | primary ref(selector).star()
  +        ref(assignableExpression) & ref(postfixOperator)
  +      | ref(primary) & ref(selector).star()
         ;
   
     selector() =>
  -       assignableSelector
  -      | arguments
  -      ;
  -
  -  assignableSelector
  -      : ref(token, '[') expression ref(token, ']')
  -      | ref(token, '.') identifier
  +        ref(assignableSelector)
  +      | ref(arguments)
  +      ;
  +
  +  assignableSelector() =>
  +        ref(token, '[') & ref(expression) & ref(token, ']')
  +      | ref(token, '.') & ref(identifier)
         ;
   
     primary() =>
  -       {!parseFunctionExpressions}?=> primaryNoFE
  -      | primaryFE
  +        ref(primaryNoFE)
  +      | ref(primaryFE)
         ;
   
     primaryFE() =>
  -       functionExpression
  -      | primaryNoFE
  +        ref(functionExpression)
  +      | ref(primaryNoFE)
         ;
   
     primaryNoFE() =>
  -       THIS
  -      | SUPER assignableSelector
  -      | literal
  -      | identifier
  -      | ref(CONST).optional() ref(typeArguments).optional() compoundLiteral
  -      | (NEW | CONST) type (ref(token, '.') identifier).optional() arguments
  -      | expressionInParentheses
  -      ;
  -
  -  expressionInParentheses
  -      :ref(token, '(') expression ref(token, ')')
  +        ref(THIS)
  +      | ref(SUPER) & ref(assignableSelector)
  +      | ref(literal)
  +      | ref(identifier)
  +      | ref(CONST).optional() & ref(typeArguments).optional() & ref(compoundLiteral)
  +      | (ref(NEW) | ref(CONST)) & ref(type) & (ref(token, '.') & ref(identifier)).optional() & ref(arguments)
  +      | ref(expressionInParentheses)
  +      ;
  +
  +  expressionInParentheses() =>
  +        ref(token, '(') & ref(expression) & ref(token, ')')
         ;
   
     literal() =>
  -       NULL
  -      | TRUE
  -      | FALSE
  -      | HEX_NUMBER
  -      | NUMBER
  -      | STRING
  -      ;
  -
  -  compoundLiteral
  -      : listLiteral
  -      | mapLiteral
  -      ;
  -
  -// The list literal syntax doesn't allow elided elements, unlike
  -// in ECMAScript. We do allow a trailing comma.
  +        ref(NULL)
  +      | ref(TRUE)
  +      | ref(FALSE)
  +      | ref(HEX_NUMBER)
  +      | ref(NUMBER)
  +      | ref(STRING)
  +      ;
  +
  +  compoundLiteral() =>
  +        ref(listLiteral)
  +      | ref(mapLiteral)
  +      ;
  +
     listLiteral() =>
  -       '[' (expressionList ','?).optional() ']'
  +        ref(token, '[') & (ref(expressionList) & ref(token, ',').optional()).optional() & ref(token, ']')
         ;
   
     mapLiteral() =>
  -       '{' (mapLiteralEntry (',' mapLiteralEntry).star() ','?).optional() '}'
  +        ref(token, '{') & (ref(mapLiteralEntry) & (ref(token, ',') & ref(mapLiteralEntry)).star() & ref(token, ',').optional()).optional() & ref(token, '}')
         ;
   
     mapLiteralEntry() =>
  -       STRING ':' expression
  +        ref(STRING) & ref(token, ':') & ref(expression)
         ;
   
     functionExpression() =>
  -       (ref(returnType).optional() identifier).optional() formalParameterList functionExpressionBody
  +        (ref(returnType).optional() & ref(identifier)).optional() & ref(formalParameterList) & ref(functionExpressionBody)
         ;
   
     functionDeclaration() =>
  -       ref(returnType).optional() identifier formalParameterList
  +        ref(returnType).optional() & ref(identifier) & ref(formalParameterList)
         ;
   
     functionPrefix() =>
  -       ref(returnType).optional() identifier
  +        ref(returnType).optional() & ref(identifier)
         ;
   
     functionBody() =>
  -       '=>' expression ';'
  -      | block
  +        ref(token, '=>') & ref(expression) & ref(token, ';')
  +      | ref(block)
         ;
   
     functionExpressionBody() =>
  -       '=>' expression
  -      | block
  +        ref(token, '=>') & ref(expression)
  +      | ref(block)
         ;
   
     // -----------------------------------------------------------------
     // Library files.
     // -----------------------------------------------------------------
     libraryUnit() =>
  -       libraryDefinition EOF
  +        ref(libraryDefinition).end()
         ;
   
     libraryDefinition() =>
  -       LIBRARY '{' libraryBody '}'
  +        ref(LIBRARY) & ref(token, '{') & ref(libraryBody) & ref(token, '}')
         ;
   
     libraryBody() =>
  -       ref(libraryImport).optional() ref(librarySource).optional()
  +        ref(libraryImport).optional() & ref(librarySource).optional()
         ;
   
     libraryImport() =>
  -       IMPORT '=' '[' ref(importReferences).optional() ']'
  +        ref(IMPORT) & ref(token, '=') & ref(token, '[') & ref(importReferences).optional() & ref(token, ']')
         ;
   
     importReferences() =>
  -       importReference (',' importReference).star() ','?
  +        ref(importReference) & (ref(token, ',') & ref(importReference)).star() & ref(token, ',').optional()
         ;
   
     importReference() =>
  -       (IDENTIFIER ':').optional() STRING
  +        (ref(IDENTIFIER) & ref(token, ':')).optional() & ref(STRING)
         ;
   
     librarySource() =>
  -       SOURCE '=' '[' ref(sourceUrls).optional() ']'
  +        ref(SOURCE) & ref(token, '=') & ref(token, '[') & ref(sourceUrls).optional() & ref(token, ']')
         ;
   
     sourceUrls() =>
  -       STRING (',' STRING).star() ','?
  +        ref(STRING) & (ref(token, ',') & ref(STRING)).star() & ref(token, ',').optional()
         ;
   
   
  
positive.code:       ;
  
    argumentList() =>
          ref(namedArgument) & (ref(token, ',') & namedArgument).star()
        | ref(expressionList) & (ref(token, ',') & namedArgument).star()
        ;
  
    namedArgument() =>
  
negative.code:   // Lexical tokens.
    // -----------------------------------------------------------------
    IDENTIFIER_NO_DOLLAR() =>
          ref(IDENTIFIER_START_NO_DOLLAR) & ref(IDENTIFIER_PART_NO_DOLLAR).star()
        ;
  
    IDENTIFIER() =>
          ref(IDENTIFIER_START) & ref(IDENTIFIER_PART).star()
        ;
  
    HEX_NUMBER() =>
          string('0x') & ref(HEX_DIGIT).plus()
        | string('0X') & ref(HEX_DIGIT).plus()
        ;
  
    NUMBER() =>
          ref(DIGIT).plus() & ref(NUMBER_OPT_FRACTIONAL_PART) & ref(EXPONENT).optional() & ref(NUMBER_OPT_ILLEGAL_END)
        | char('.') & ref(DIGIT).plus() & ref(EXPONENT).optional() & ref(NUMBER_OPT_ILLEGAL_END)
        ;
  
    NUMBER_OPT_FRACTIONAL_PART() =>
          char('.') & ref(DIGIT).plus()
        | epsilon()
        ;
  
    NUMBER_OPT_ILLEGAL_END() => epsilon();
  //        ref(IDENTIFIER_START).end()
  //      | epsilon()
  //      ;
  
    HEX_DIGIT() => pattern('0-9a-fA-F');
  
    IDENTIFIER_START() => ref(IDENTIFIER_START_NO_DOLLAR) | char('\$');
  
    IDENTIFIER_START_NO_DOLLAR() => ref(LETTER) | char('_');
  
    IDENTIFIER_PART_NO_DOLLAR() => ref(IDENTIFIER_START_NO_DOLLAR) | ref(DIGIT);
  
    IDENTIFIER_PART() => ref(IDENTIFIER_START) | ref(DIGIT);
  
    LETTER() => letter;
  
    DIGIT() => digit();
  
    EXPONENT() => pattern('eE') & pattern('+-').optional() & ref(DIGIT).plus();
  
    STRING() =>
          char('@').optional() & ref(MULTI_LINE_STRING)
        | ref(SINGLE_LINE_STRING)
        ;
  
    MULTI_LINE_STRING() =>
          string('"""') & any().starLazy(string('"""')) & string('"""')
        | string("'''") & any().starLazy(string("'''")) & string("'''")
        ;
  
    SINGLE_LINE_STRING() =>
          char('"') & ref(STRING_CONTENT_DQ).star() & char('"')
        | char("'") & ref(STRING_CONTENT_SQ).star() & char("'")
        | string('@"') & pattern('^"\n\r').star() & char('"')
        | string("@'") & pattern("^'\n\r").star() & char("'")
        ;
  
    STRING_CONTENT_DQ() =>
          pattern('^\\"\n\r')
        | char('\\') & pattern('\n\r')
        ;
  
    STRING_CONTENT_SQ() =>
          pattern("^\\'\n\r")
        | char('\\') & pattern('\n\r')
        ;
  
    NEWLINE() => pattern('\n\r');
  
    HASHBANG() => string('#!') & pattern('^\n\r').star() & ref(NEWLINE).optional();
  
  
    // -----------------------------------------------------------------
    // Whitespace and comments.
    // -----------------------------------------------------------------
    HIDDEN() => ref(WHITESPACE) | ref(SINGLE_LINE_COMMENT) | ref(MULTI_LINE_COMMENT);
  
    WHITESPACE() => pattern(' \t\n\r').plus();
  
    SINGLE_LINE_COMMENT() => string('//') & any().starLazy(ref(NEWLINE)) & ref(NEWLINE);
  
    MULTI_LINE_COMMENT() => string('/*') & any().starLazy(string('*/')) & string('*/');
  
  }
  