optional parameter support#212
Draft
CajunAvenger wants to merge 2 commits into
Draft
Conversation
Collaborator
|
I'm sorry this is another days long detour into figuring out how the keyword parsing works that I can't afford. |
Collaborator
Author
|
you got it |
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.
While mse theoretically had support for optional keyword parameters, the placeholder text would still be rendered, eg "token<s>", so instead we used the inelegant match "toke<*s>". This PR instead adds a step to text_filter to remove placeholders with a standard overwritten name, drafted as
<atom-kwpph>hidden</atom-kwpph>This does mostly function, "Type token<plural>" and "Connive<plural><optional_number>" both work correctly. But there are two weird interactions:
this is not returning
keywordin expand_keywords(), so i think it's a hiccup in the matching, rather than some quirk in expand_keywords that returns no reminder text, and the script step that removes the empty placeholder def isn't involved. The only timeoptionalis actually referenced is adding a?to that part of the regex, so I wouldn't think it's some bug with optional placeholders. My instinct is that it's something happening in the filtering happening at possible_matches, but i can't follow it well enough to tell wherethis is probably still an acceptable update with those examples left on the old method, but wanna make sure @G-e-n-e-v-e-n-s-i-S gets a chance to check the quirks before doing that.