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

Allow end as a substring of vertex id #224

Merged
merged 1 commit into from
Oct 15, 2015

Conversation

spect88
Copy link
Collaborator

@spect88 spect88 commented Oct 14, 2015

Jison adds \b (word boundary) to literal string patterns by default.
It does so, because it doesn't follow traditional match-longest
approach, but does match-first instead. Without including word
boundaries, it'd be hard to distinguish between a keyword and
identifier.

The pattern for end keyword is not a simple string literal - it
swallows trailing whitespace, so we have to add \b manually.

This partially fixes #184 - at least now end behaves the same as other
keywords: it can be used as a prefix and infix, but not as a suffix.

To solve this issue completely, ALPHA pattern would have to match
multiple letters, which is a much bigger change.

Jison adds \b (word boundary) to literal string patterns by default.
It does so, because it doesn't follow traditional match-longest
approach, but does match-first instead. Without including word
boundaries, it'd be hard to distinguish between a keyword and
identifier.

The pattern for `end` keyword is not a simple string literal - it
swallows trailing whitespace, so we have to add \b manually.

This partially fixes mermaid-js#184 - at least now `end` behaves the same as other
keywords: it can be used as a prefix and infix, but not as a suffix.

To solve this issue completely, ALPHA pattern would have to match
multiple letters, which is a much bigger change.
knsv added a commit that referenced this pull request Oct 15, 2015
Allow `end` as a substring of vertex id
@knsv knsv merged commit e003396 into mermaid-js:master Oct 15, 2015
@knsv
Copy link
Collaborator

knsv commented Oct 15, 2015

Thanks, much appreciated!

This issue was bugging me.

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

Successfully merging this pull request may close these issues.

Weird bug in live editor when using words with substring end
2 participants