-
Notifications
You must be signed in to change notification settings - Fork 34
customize TOKENS #74
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
Comments
@gemerden Thanks. This is an easy change that makes a lot of sense Just out of curiosity, what would be custom TOKENS you would need? |
@pombredanne: i only use '|', '&' and '!', '(' and ')' and i use e.g. '*' for something else (as a wildcard). I needed to change more in tokenize(); roughly: everything that is not a token i accept as a symbol, but i need to do some more testing. Currently it looks like this:
by |
@gemerden OK, check also this other simpler tokenizer: https://github.com/nexB/license-expression/blob/master/src/license_expression/__init__.py#L1127 |
Thanks, the code above is passing all my tests, so for now i am ok. |
ok, your call. You can send a PR or close this as you like. |
In the tokenize() method of BooleanAlgebra, would it be possible to change the tokens without inheriting the whole method and changing just the tokens, e.g.:
Or perhaps define the current tokens outside the method and make them the default TOKENS instead of None above.
This makes it less likely that in future versions the inheriting class becomes outdated.
Cheers, Lars
The text was updated successfully, but these errors were encountered: