-
Notifications
You must be signed in to change notification settings - Fork 153
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
Rule label cannot contain ` or whitespace #3596
Conversation
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!
checkLabel(sentence); | ||
} | ||
|
||
private static final Pattern whitespace = Pattern.compile("\\s"); |
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.
Why didn't you include the backtick here?
You have to traverse the label twice now.
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.
it's still linear time, the string is unlikely to be long, and I doubt the impact on performance will be substantial. We can always address this later if need be. I suspect the amdahl's law on this will be pretty minimal though.
Adds a check to the compiler that reports an error if a sentence label contains the backtick character or whitespace. This ought to allow the Maude backend to compile rule labels directly to Maude identifiers without some clumsy encoding system.
I am reasonably certain that it should not break anything to add this restriction.