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

how to improve diff effect with key #193

Open
wangxi761 opened this issue Sep 10, 2020 · 5 comments
Open

how to improve diff effect with key #193

wangxi761 opened this issue Sep 10, 2020 · 5 comments
Assignees

Comments

@wangxi761
Copy link

can we mark some Syntax node as the key ,such as json key ,so we can match it more quickly

@wangxi761
Copy link
Author

image
It doesn't look right

@jrfaller jrfaller self-assigned this Sep 21, 2020
@jrfaller
Copy link
Member

Hi!

Unfortunately our json parser is in fact the Mozilla rhino js parser. Therefore it might not be perfect for json files. I am not sure to understand well what is your proposal to improve the situation?

Cheers!

@wangxi761
Copy link
Author

I have read gumtree algorithm , and it seem compare for Keyless Data ,
In many cases,at parse phase ,we could mark some Syntax with key 。
such as json key, method name and so on
in match phase , it will be more Precise and more fast

@jrfaller
Copy link
Member

In fact I think this is not really keyless since the key is contained in the subtree corresponding to the property declaration, somethig like:

ObjProp
  Key
    Name "foo"
  Value
    Value "bar"

Therefore it is taken into account at some point.

However you would prefer something more direct like:

ObjProp
  Key "foo"
  Value "bar"

(note that these are not the real names of ast nodes, just made up for the sake of the example).

Is it that?

@jrfaller
Copy link
Member

Any follow-up on this issue ?

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

No branches or pull requests

2 participants