-
Notifications
You must be signed in to change notification settings - Fork 242
Use [^...] rather than '[...] (neg)' to print NCLASS #580
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
Use [^...] rather than '[...] (neg)' to print NCLASS #580
Conversation
|
It looks better, but we loose the "nclass" information from the output. Could we keep it some way? (Note: classes can contain |
|
0e2bf18 to
77dbf7c
Compare
|
Well-spotted. This is an existing bug for XCLASS printing - and worse, even backslash isn't escaped currently! I've fixed those cases too (and added tests). |
77dbf7c to
913ca2e
Compare
|
I think |
|
You're saying that, because we use "[^a]" to represent OP_NOT, you want the output for an OP_NCLASS to be distinguishable. That makes sense. And we're using the "!" notation in eclasses, so that's a consistent notation to use for OP_NCLASS. I am half-way through the optimisation work. You might be happy to know that the OP_ECLASS_NOT code will disappear when I'm finished (it will always be constant-folded in to atomic classes within the eclass). |
|
Yes. The purpose of /B is debugging, and less constructs have the same text representation is the better. Removing OP_ECLASS_NOT is good news indeed, nice work! How do you encode |
We know that |
|
Actually... I think I'd rather keep it so that NCLASS prints as |
913ca2e to
a3fa1f1
Compare
a3fa1f1 to
e24fded
Compare
zherczeg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a cosmetic change in the tests. It looks much better.
I've also fixed a highly confusing comment in printint.c which suggests that the character map for XCLASS behaves differently to NCLASS (it doesn't now - perhaps it did previously).