Skip to content

AST missing last tokens when syntax error #8

@apb2006

Description

@apb2006

Running in https://github.com/wcandillon/xqlint

var XQLint = require('../lib/xqlint').XQLint;
var linter = new XQLint('2 +');
console.log(linter.printAST());

The XQueryParser is

// This file was generated on Fri Apr 10, 2015 00:54 (UTC+01) by REx v5.33 which is Copyright (c) 1979-2015 by Gunther Rademacher <grd@gmx.net>
// REx command line: XQueryParser.ebnf -ll 2 -backtrack -tree -javascript -a xqlint

result

<XQuery>
    <Module>
      <MainModule>
        <Prolog>
        </Prolog>
        <Program>
          <StatementsAndOptionalExpr>
            <Statements>
            </Statements>
            <Expr>
              <ExprSingle>
                <ExprSimple>
                  <AdditiveExpr>
                    <PrimaryExpr>
                      <Literal>
                        <NumericLiteral>
                          <IntegerLiteral>2</IntegerLiteral>
                          <IntegerLiteral>
                          </IntegerLiteral>
                        </NumericLiteral>
                      </Literal>
                    </PrimaryExpr>
                    <WS> </WS>
                    <WS>
                    </WS>
                    <TOKEN>+</TOKEN>
                    <TOKEN>
                    </TOKEN>
                  </AdditiveExpr>
                </ExprSimple>
              </ExprSingle>
            </Expr>
          </StatementsAndOptionalExpr>
        </Program>
      </MainModule>
    </Module>
  </XQuery>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions