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

Allowing other characters in a token #86

Open
carpie opened this issue May 9, 2019 · 1 comment
Open

Allowing other characters in a token #86

carpie opened this issue May 9, 2019 · 1 comment

Comments

@carpie
Copy link
Contributor

carpie commented May 9, 2019

When using UUIDs in tokens, the tokens are rejected because of the - character in them. I can subclass BooleanAlgebra and override tokenize but it is a lot of duplication for allowing an additional character in the token. It would be nice if one could specify the allowable character set.

@pombredanne
Copy link
Collaborator

Thanks for this and sorry for the late reply and review. It kinda makes sense... the rationale for only allowing certain characters is that tokens could then be used as Python-level identifiers and to avid possibly collision with short-form operators (~+| ... etc). In practice this is not big requirement IMHO. In fact in https://github.com/nexB/license-expression/ we accept any characters in tokens and have implemented a few custom tokenizers too.

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

2 participants