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

Class-based paradigm for pattern construction #101

Open
bskinn opened this issue Jan 4, 2022 · 0 comments
Open

Class-based paradigm for pattern construction #101

bskinn opened this issue Jan 4, 2022 · 0 comments

Comments

@bskinn
Copy link
Owner

bskinn commented Jan 4, 2022

Token, Line, and Pattern objects

+ operator always constructs Line objects. & always constructs Pattern objects. & has lower operator precedence, which should make complex expressions coalesce in a sane way.

__repr__() for each class should be dovetailed with the objects' constructors to allow re-instantiation of the object.

The head, body, and tail of Parser then will really just take Pattern instances (as well as Parser instances), though automatic promotion of Token --> Line --> Pattern would make sense as a helper.

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

1 participant