Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Arbitrary Field Access #57

Open
3 tasks
sunjay opened this issue Mar 4, 2017 · 0 comments
Open
3 tasks

Arbitrary Field Access #57

sunjay opened this issue Mar 4, 2017 · 0 comments

Comments

@sunjay
Copy link
Owner

sunjay commented Mar 4, 2017

In order to implement arbitrary field access, you technically need to apply left-recursion which is notoriously hard in a PEG grammar. To make things easier, this was left out of the initial parser code.

Implementation Notes

Do something like what was done to support conditionals: parse everything in sequence and then nest everything together in one step.

  • Be able to access fields to an arbitrary depth: a.b, a.b.c, a.b.c.d.e, etc.
  • Fields should be properly nested so that foo.bar.spam.car is equivalent to ((foo.bar).spam).car.
  • Should be able to access fields on pretty much any valid expression (identifiers, string literals, numbers, groups, etc.)
    • Note that this does not imply fields can be any other type other than identifier
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant