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

fix(developer): kmc code generation for context(n) in context #9932

Merged

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Nov 3, 2023

Fixes #9930.

  • Fixes the index offset calculation, with +1 for >=v10.0 keyboards and -1 for <v10.0 keyboards (difference is because older version keyboards have context offsets calculated in the opposite direction). Note that this happened because the CODE_CONTEXTEX index is stored in memory as 0-based in kmc, but was 1-based in kmcomp.

  • Adds unit tests for v9.0 and v10.0 keyboards for context(n) in context.

  • Adds unit tests for v9.0 and v10.0 keyboards for context(n) in output. These were already correct but now we can be assured that they are being tested.

  • Enables code coverage for kmw-compiler, and sets a lower threshold for pass because coverage is still just over 70%.

@keymanapp-test-bot skip

Fixes #9930.

* Fixes the index offset calculation, with +1 for >=v10.0 keyboards and
  -1 for <v10.0 keyboards (difference is because older version keyboards
  have context offsets calculated in the opposite direction). Note that
  this happened because the `CODE_CONTEXTEX` index is stored in memory
  as 0-based in kmc, but was 1-based in kmcomp.

* Adds unit tests for v9.0 and v10.0 keyboards for `context(n)` in
  context.

* Adds unit tests for v9.0 and v10.0 keyboards for `context(n)` in
  output. These were already correct but now we can be assured that
  they are being tested.

* Enables code coverage for kmw-compiler, and sets a lower threshold for
  pass because coverage is still just over 70%.
@mcdurdin mcdurdin requested a review from darcywong00 as a code owner November 3, 2023 05:34
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Nov 3, 2023

User Test Results

Test specification and instructions

User tests are not required

Test Artifacts

Copy link
Contributor

@ermshiperete ermshiperete left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcdurdin mcdurdin merged commit c6fdb76 into master Nov 3, 2023
3 checks passed
@mcdurdin mcdurdin deleted the fix/developer/9930-kmc-invalid-for-context-n-in-context branch November 3, 2023 07:43
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.205-alpha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(developer): kmc generates invalid code for context(n) in context part of rule
3 participants