-
-
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
fix(developer): raise error if virtual key in context string #9908
fix(developer): raise error if virtual key in context string #9908
Conversation
Fixes #7880. Virtual keys have never been allowed in context. This should be an error in a keyboard. Note: virtual keys in output are officially unsupported but still kinda sorta a little bit work in Windows -- but I doubt they will ever be officially supported. Also includes small side journey to tidy up names and constants for two other tests (error_duplicate_group and error_duplicate_store).
User Test ResultsTest specification and instructions User tests are not required |
@@ -54,15 +54,22 @@ describe('CompilerMessages', function () { | |||
// CERR_DuplicateGroup | |||
|
|||
it('should generate CERR_DuplicateGroup if the kmn contains two groups with the same name', async function() { | |||
await testForMessage(this, ['invalid-keyboards', 'cerr_duplicate_group.kmn'], 0x302071); //TODO: consolidate messages from kmcmplib, CompilerMessages.CERR_DuplicateGroup | |||
await testForMessage(this, ['invalid-keyboards', 'error_duplicate_group.kmn'], KmnCompilerMessages.ERROR_DuplicateGroup); //TODO: consolidate messages from kmcmplib, CompilerMessages.CERR_DuplicateGroup |
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.
await testForMessage(this, ['invalid-keyboards', 'error_duplicate_group.kmn'], KmnCompilerMessages.ERROR_DuplicateGroup); //TODO: consolidate messages from kmcmplib, CompilerMessages.CERR_DuplicateGroup | |
await testForMessage(this, ['invalid-keyboards', 'error_duplicate_group.kmn'], KmnCompilerMessages.ERROR_DuplicateGroup); |
store (consonant) "lmn" | ||
store (sylcons) U+1E37 U+1E43 U+1E47 | ||
|
||
|
||
c ERROR_VirtualKeyInContext | ||
[K_BKQUOTE] + any(consonant) > index (sylcons, 2) |
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.
store (consonant) "lmn" | |
store (sylcons) U+1E37 U+1E43 U+1E47 | |
c ERROR_VirtualKeyInContext | |
[K_BKQUOTE] + any(consonant) > index (sylcons, 2) | |
c ERROR_VirtualKeyInContext | |
[K_BKQUOTE] + 'a' > 'b' |
@@ -1316,6 +1316,9 @@ KMX_BOOL CheckContextStatementPositions(PKMX_WCHAR context) { | |||
AddWarningBool(CWARN_IfShouldBeAtStartOfContext); | |||
} | |||
break; | |||
case CODE_EXTENDED: | |||
AddCompileError(CERR_VirtualKeyInContext); |
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.
Update the function comment to note this test.
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
Changes in this pull request will be available for download in Keyman version 17.0.204-alpha |
Fixes #7880.
Virtual keys have never been allowed in context. This should be an error in a keyboard. Note: virtual keys in output are officially unsupported but still kinda sorta a little bit work in Windows -- but I doubt they will ever be officially supported.
Also includes small side journey to tidy up names and constants for two other tests (error_duplicate_group and error_duplicate_store).
@keymanapp-test-bot skip