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

Constants Self and/or self to self-reference current parselet #31

Closed
phorward opened this issue Dec 16, 2021 · 3 comments
Closed

Constants Self and/or self to self-reference current parselet #31

phorward opened this issue Dec 16, 2021 · 3 comments
Assignees
Labels
feature New feature or request

Comments

@phorward
Copy link
Member

phorward commented Dec 16, 2021

To refer the current parselet itself, as self keyword might be useful. This is also relevant for #10

@{ Self 'T' | 'T' }  # matches T TT TTT TTTTTTTTT...
@phorward phorward added the feature New feature or request label Dec 16, 2021
@phorward phorward changed the title self reference current parselet Self reference current parselet Mar 5, 2022
@phorward
Copy link
Member Author

9070985 introduces a case where the Self parselet is obligatory: Due implementation of the Token prelude parselet in #51, the Token parselet from tokay.tok uses this Token, and needed to be renamed to Token1 to behave like before. The use of Self in this case would redefine Token without use of its previous definition.

@phorward
Copy link
Member Author

Another note on this:

  • self references the current parselet in runtime-mode
  • Self references the current parselet in compile-time mode - may only be used when the parselet is consuming!

@phorward phorward changed the title Self reference current parselet Constants Self and/or self to self-reference current parselet Aug 20, 2022
@phorward phorward self-assigned this Oct 17, 2022
phorward added a commit to phorward/tokay that referenced this issue Jun 7, 2023
@phorward
Copy link
Member Author

phorward commented Jun 7, 2023

Fixed by d966e2a

@phorward phorward closed this as completed Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant