Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write and use toStringTreeIndented function instead of toStringTree for .tree files comparison #4

Open
KvanTTT opened this issue Jun 7, 2017 · 2 comments

Comments

@KvanTTT
Copy link
Member

KvanTTT commented Jun 7, 2017

It improves and simplifies diff for .tree files.
See also antlr/grammars-v4#748 and antlr/antlr4#1502.

teverett added a commit that referenced this issue Sep 5, 2020
….plugins-maven-antrun-plugin-3.0.0

Bump maven-antrun-plugin from 1.8 to 3.0.0
@Marti2203
Copy link

Hi, I see there has not been any change? Is it possible to work on this fix?

@KvanTTT
Copy link
Member Author

KvanTTT commented Sep 12, 2021

I don't think so becuase firstly we should choose a format for parsing tree rendering. It should be lightweight and convenient for machine comparison. I suggest the following one, without parentheses:

propertyDeclaration
  VAL("val")
  variableDeclaration
    simpleIdentifier
      Identifier("result")
  ASSIGNMENT("=")
  expression
    disjunction
      conjunction
        equality
          comparison
            infixOperation
              elvisExpression
                infixFunctionCall
                  rangeExpression
                    additiveExpression
                      multiplicativeExpression
                        asExpression
                          prefixUnaryExpression
                            postfixUnaryExpression
                              primaryExpression
                                simpleIdentifier
                                  Identifier("ArrayList")
  DOT(".")
  THIS("this")
  DOT(".")
  Identifier("remove")
  LPAREN("(")
  Identifier("index")
  SUB("-")
  IntegerLiteral("1")
  RPAREN(")")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants