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

How to match end of input? #626

Open
gajus opened this issue Oct 1, 2022 · 1 comment
Open

How to match end of input? #626

gajus opened this issue Oct 1, 2022 · 1 comment

Comments

@gajus
Copy link

gajus commented Oct 1, 2022

I need to distinguish between a whitespace and an empty string, i.e. foo:, foo:bar and foo: (this one has space) need to be treated differently.

Is there a special keyword for end of input?

@PoolloverNathan
Copy link

This repository seems dead, but if someone is still around, I would like to propose syntax:

  • A ?= token in completeexpression which is followed by another expr. The second expr will be matched at the current position as if the ?= wasn't there, but the cursor will not be affected/will be rewinded. (It exists in my fork, but is not implemented yet.)
  • A $ token at the end of completeexpression which causes it to only match at the end of input.

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

2 participants