hoon: fix mixed-case aura tokenisation#3002
Merged
RunDevelopment merged 2 commits intoPrismJS:masterfrom Jul 19, 2021
matildepark:master
Merged
hoon: fix mixed-case aura tokenisation#3002RunDevelopment merged 2 commits intoPrismJS:masterfrom matildepark:master
RunDevelopment merged 2 commits intoPrismJS:masterfrom
matildepark:master
Conversation
components/prism-hoon.js
Outdated
| 'class-name': [ | ||
| { | ||
| pattern: /@(?:[A-Za-z0-9-]*[A-Za-z0-9])?/, | ||
| greedy: true |
Member
There was a problem hiding this comment.
greedy: true is one way to fix it. However, greedy: true is more expensive performance-wise and there is an even simpler fix: Just swap the order of function and class-name.
Swapping them should have the same result without the performance hit.
Contributor
Author
|
Fair enough! Patched. |
RunDevelopment
approved these changes
Jul 19, 2021
Member
|
Thank you very much @matildepark! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In Hoon, we have "auras", which are categories of atoms, which are themselves just positive integers. These look like
@dabut are sometimes, mixed-case, lowercase then uppercase, like@tDin the Caesar cipher example. These were incorrectly parsed, and are fixed in this PR. Compare the test diffs for an example.