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

generalize state -- allow any state to be passed around #16

Open
mattfenwick opened this issue Jan 9, 2016 · 0 comments
Open

generalize state -- allow any state to be passed around #16

mattfenwick opened this issue Jan 9, 2016 · 0 comments

Comments

@mattfenwick
Copy link
Owner

Currently, a parser requires a rest and state parameter, and a parse result has a rest and state field.

These are both 'states' in the monad sense, and it might be useful for clients to have more state passed:

  • parse input (string)
  • parse position: index, line, column
  • table of operator precedences -- modeling this as state allows it to be dynamically (contextually) updated

Also, note that the current state field is pretty exclusively used for position tracking, even though its name doesn't indicate that. That's confusing.

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

1 participant