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

Add _"squash"_ expressions to TatSu grammars #135

Open
apalala opened this issue Jun 1, 2019 · 2 comments
Open

Add _"squash"_ expressions to TatSu grammars #135

apalala opened this issue Jun 1, 2019 · 2 comments

Comments

@apalala
Copy link
Collaborator

apalala commented Jun 1, 2019

The idea is taken from peg in which the expression:

 < e1 e2 ... en >

yields the concatenation e1+e2+...+en.

@apalala
Copy link
Collaborator Author

apalala commented Jun 1, 2019

There needs to be syntax for this, and it might be the +() grouping operator, as the + appears in TatSu grammars only in {}+.

rule == e1 +(e2 e3) e4`

Could yield: (e1, e2+e3, e4)

@apalala
Copy link
Collaborator Author

apalala commented Jun 1, 2019

What happens is the types of the elements are different? The types can currently be: str, tuple, closure, AST, and Node. Define an algebra over the + operator?

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