-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
feat(core): support stacked markers, prep for marker segments 🙀 #10326
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
52fe907
chore(core): stacked markers tests 🙀
srl295 f4be785
feat(core): stacked markers tests 🙀
srl295 b2b8979
feat(core): stacked markers 🙀
srl295 776a902
feat(core): stacked markers 🙀
srl295 74b5530
Merge branch 'master' into feat/core/10320-stack-markers-epic-ldml
srl295 0d9f543
Apply suggestions from code review
srl295 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,13 +316,26 @@ size_t ldml_processor::process_output(km_core_state *state, const std::u32string | |
// drop last 'matchedContext': | ||
ctxtstr.resize(ctxtstr.length() - matchedContext); | ||
ctxtstr.append(outputString); // TODO-LDML: should be able to do a normalization-safe append here. | ||
ldml::marker_map markers; | ||
assert(ldml::normalize_nfd_markers(ctxtstr, markers)); // TODO-LDML: Need marker-safe normalize here. | ||
{ | ||
const auto normalize_ok = ldml::normalize_nfd_markers(ctxtstr); | ||
assert(normalize_ok); | ||
if(!normalize_ok) { | ||
DebugLog("ldml_processor::process_output: failed ldml::normalize_nfd_markers(ctxtstr)"); | ||
} | ||
} | ||
|
||
// Ok. We've done all the happy manipulations. | ||
|
||
/** NFD w/ markers */ | ||
std::u32string ctxtstr_cleanedup = ctxtstr; | ||
{ | ||
const auto normalize_ok = ldml::normalize_nfd_markers(ctxtstr_cleanedup); | ||
assert(normalize_ok); | ||
if(!normalize_ok) { | ||
DebugLog("ldml_processor::process_output: failed ldml::normalize_nfd_markers(ctxtstr_cleanedup)"); | ||
} | ||
} | ||
|
||
Comment on lines
+331
to
+338
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto, do we need to abort processing? |
||
assert(ldml::normalize_nfd_markers(ctxtstr_cleanedup)); | ||
|
||
// find common prefix. | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,8 +75,8 @@ https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-keyboar | |
|
||
<transform from="8e\m{stampy}\u{0300}\m{lgtm}\u{0320}" to="YES8a" /> | ||
<transform from="8e\u{0300}\m{stampy}\m{lgtm}\u{0320}" to="YES8b" /> | ||
<transform from="8e\u{0300}\u{0320}\m{stampy}\m{lgtm}" to="FAIL" /> <!-- denormalized, nomatch --> | ||
<transform from="8e\u{0320}\u{0300}\m{stampy}\m{lgtm}" to="YES8d" /> <!-- NFD --> | ||
<transform from="8e\u{0300}\u{0320}\m{stampy}\m{lgtm}" to="YES8c" /> <!-- denormalized, but matches --> | ||
<transform from="8f\u{0320}\u{0300}\m{stampy}\m{lgtm}" to="YES8d" /> <!-- NFD --> | ||
Comment on lines
-78
to
+79
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The one with FAIL didn't use to match because of two markers. But now, it can match either way! 💯 |
||
|
||
<!-- normalization in output --> | ||
<transform from="9a" to="9e\u{0300}\u{0320}" /> <!-- no marker, denormalized --> | ||
|
Oops, something went wrong.
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.
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.
Do we need to abort processing in release builds?
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.
If it fails the string is just unchanged and so the match may not work properly or wrong output. But there's no inherent danger in proceeding.
Is it worth trying to pop up an error code to the engine? I thought the answer before was, no.
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.
No danger is what I was looking for. There's no way we can pop an error, so 'bad output' is the best error we can do. (And no, don't even think about emitting an error as key events "YOUR KEYBOARD HAS GONE WRONG" emitted every time you press a key?!)