Skip to content

Added better node position logging#1192

Closed
TeemoKill wants to merge 0 commit intopingcap:masterfrom
TeemoKill:master
Closed

Added better node position logging#1192
TeemoKill wants to merge 0 commit intopingcap:masterfrom
TeemoKill:master

Conversation

@TeemoKill
Copy link

What problem does this PR solve?

Maybe #910 -> How do I get the position of an AST node.
The previous solution logged the starting offset of the original text,
this pull request added more detailed position information to ast.Node

What is changed and how it works?

Moved the struct Pos from parser/lexer.go into parser/ast/ast.go

Added 2 methods

func (ast.node) SetOriginTextPos(ast.Pos) 
func (ast.node) OriginTextPos() ast.Pos

to the interface ast.Node

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change

Side effects

  • Possible performance regression
  • Breaking backward compatibility

Related changes

N/A

@tangenta
Copy link
Contributor

Hi @TeemoKill, would you like to explain why we need this feature? Did you encounter any problems?

@ti-chi-bot
Copy link
Member

@TeemoKill: PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Yifan Luo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants