diff --git a/.github/workflows/deb-packaging.README.md b/.github/workflows/deb-packaging.README.md new file mode 100644 index 00000000000..a1b1c12d122 --- /dev/null +++ b/.github/workflows/deb-packaging.README.md @@ -0,0 +1,22 @@ +# Debian Packaging GitHub Action + +You can manually trigger a deb-packaging action on GitHub, e.g. to test changes: + +- push the changes to your fork of keymanapp/keyman: git push myfork HEAD:master +- make sure you have GHA enabled in the settings of your fork and created an + access token on GitHub +- trigger a build with: + + ```bash + curl --write-out '\n' --request POST \ + --header "Accept: application/vnd.github+json" \ + --header "Authorization: token $GITHUB_TOKEN" \ + --data "{ \"event_type\": \"deb-pr-packaging: master\", \ + \"client_payload\": { \ + \"buildSha\": \"$(git rev-parse refs/heads/master)\", \ + \"headSha\": \"$(git rev-parse refs/heads/master)\", \ + \"branch\": \"master\", \ + \"isTestBuild\": \"true\"}" \ + https://api.github.com/repos//keyman/dispatches + + ``` diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml index 14ce64b9d1b..10edcbab173 100644 --- a/.github/workflows/deb-packaging.yml +++ b/.github/workflows/deb-packaging.yml @@ -3,6 +3,15 @@ run-name: "Ubuntu packaging - ${{ github.event.client_payload.branch }} (branch on: repository_dispatch: types: ['deb-release-packaging:*', 'deb-pr-packaging:*'] + +# Input: +# buildSha: The SHA of the commit to build, e.g. of the branch or +# refs/pull/1234/merge for PR +# headSha: The SHA of the branch head. Same as buildSha for regular +# builds, SHA of refs/pull/1234/head for PRs +# branch: The branch to build, for a PR in the form `PR-1234` +# isTestBuild: false for Releases, otherwise true + env: COLOR_GREEN: "\e[32m" GH_TOKEN: ${{ github.token }} @@ -16,25 +25,22 @@ jobs: runs-on: ubuntu-22.04 outputs: VERSION: ${{ steps.version_step.outputs.VERSION }} - GIT_SHA: ${{ steps.set_status.outputs.GIT_SHA }} PRERELEASE_TAG: ${{ steps.prerelease_tag.outputs.PRERELEASE_TAG }} steps: - name: Checkout uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0 with: - ref: '${{ github.event.client_payload.ref }}' + ref: '${{ github.event.client_payload.buildSha }}' - name: Set pending status on PR builds id: set_status if: github.event.client_payload.isTestBuild == 'true' shell: bash run: | - GIT_SHA="${{ github.event.client_payload.sha }}" - echo "GIT_SHA=$GIT_SHA" >> $GITHUB_OUTPUT gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ - /repos/$GITHUB_REPOSITORY/statuses/$GIT_SHA \ + /repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.headSha }} \ -f state='pending' \ -f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ -f description='Debian packaging started' \ @@ -86,7 +92,7 @@ jobs: if [ "${{ github.event.client_payload.isTestBuild }}" == "true" ]; then echo ":checkered_flag: **Test build of version ${{ steps.version_step.outputs.VERSION }} for ${{ github.event.client_payload.branch }}**" >> $GITHUB_STEP_SUMMARY else - echo ":ship: **Release build of ${{ github.event.client_payload.branch }} branch (${{ github.event.client_payload.ref}}), version ${{ steps.version_step.outputs.VERSION }}**" >> $GITHUB_STEP_SUMMARY + echo ":ship: **Release build of ${{ github.event.client_payload.branch }} branch (${{ github.event.client_payload.branch}}), version ${{ steps.version_step.outputs.VERSION }}**" >> $GITHUB_STEP_SUMMARY fi echo "" >> $GITHUB_STEP_SUMMARY echo ":gift: Generated source package:" >> $GITHUB_STEP_SUMMARY @@ -229,7 +235,7 @@ jobs: - name: Checkout uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c #v3.3.0 with: - ref: '${{ github.event.client_payload.ref }}' + ref: '${{ github.event.client_payload.buildSha }}' - name: Download Artifacts uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 @@ -286,7 +292,7 @@ jobs: gh api \ --method POST \ -H "Accept: application/vnd.github+json" \ - /repos/$GITHUB_REPOSITORY/statuses/${{ needs.sourcepackage.outputs.GIT_SHA }} \ + /repos/$GITHUB_REPOSITORY/statuses/${{ github.event.client_payload.headSha }} \ -f state="$RESULT" \ -f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ -f description="$MSG" \ diff --git a/HISTORY.md b/HISTORY.md index 8bc6b8f02aa..81d403b9b9c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,37 @@ # Keyman Version History +## 17.0.205 alpha 2023-11-03 + +* fix(developer): use KeymanWeb.Codes for 17.0+ (#9913) +* fix(developer): don't use osk-always-visible on touch devices (#9917) +* chore(linux): Improve repository_dispatch (#9865) +* chore(linux): Refactor deb-packaging.sh script (#9866) +* chore(linux): Add Core API version number (#9877) +* fix(developer): kmc code generation for context(n) in context (#9932) +* chore(developer): remove obsolete 'Allow Multiple Instances' and 'Use Legacy Compiler' options (#9934) +* chore(developer): common/include dep for kmcmplib (#9935) +* feat(common): ldml update to WIP cldr data (#9919) + +## 17.0.204 alpha 2023-11-02 + +* fix(web): fixes doc-kbd display of default layer when it's not defined first (#9891) +* fix(developer): compiler crash when no project loaded (#9898) +* fix(developer): debug flag for compiling keyboards (#9901) +* chore(developer): verify kmp.json output from kmc-package (#9844) +* fix(developer): Project MRU now saves correctly (#9902) +* chore(common): fixup SchemaValidators error handling (#9903) +* chore(developer): change field label to 'Related Package ID' in Related Packages dialog (#9904) +* fix(developer): open editor links in new window (#9905) +* fix(developer): enable and update unit tests (#9907) +* fix(developer): layout builder - maintain presentation during undo (#9914) +* feat(developer): extract font family from .ttf in kmc-keyboard-info (#9859) +* fix(developer): raise error if virtual key in context string (#9908) +* feat(developer): Compile button in TIKE toolbar (#9910) +* chore(developer): rename messages.ts for clarity (#9920) +* fix(developer): warn if layer switch key is missing ID (#9921) +* fix(developer): restore selection in layout builder even with duplicate ids (#9922) +* fix(developer): enable line breaks in debugger (#9906) + ## 17.0.203 alpha 2023-10-30 * fix(linux): Fix uninstallation of shared keyboard (#9880) diff --git a/VERSION.md b/VERSION.md index d8de415ab0b..98f9b53f4a7 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.204 \ No newline at end of file +17.0.206 \ No newline at end of file diff --git a/common/windows/delphi/general/RegistryKeys.pas b/common/windows/delphi/general/RegistryKeys.pas index 57f865f9b29..62599851cd2 100644 --- a/common/windows/delphi/general/RegistryKeys.pas +++ b/common/windows/delphi/general/RegistryKeys.pas @@ -103,8 +103,7 @@ interface SRegValue_Engine_OEMProductPath = 'oem product path'; -// SRegValue_UnknownLayoutID = 'unknown layout id'; // LM - SRegValue_Legacy_Default_UnknownLayoutID = '000005FE'; // I4220 + SRegValue_Legacy_Default_UnknownLayoutID = '000005FE'; // I4220 SRegValue_KeymanDebug = 'debug'; // CU @@ -112,11 +111,8 @@ interface SRegValue_ShowStartup = 'show startup'; // CU SRegValue_ShowWelcome = 'show welcome'; // CU - //SRegValue_NoCheckAssociations = 'no check associations'; // CU SRegValue_UseAdvancedInstall = 'use advanced install'; // CU -//TOUCH SRegValue_UseTouchLayout = 'use touch layout'; // CU, default false - SRegValue_AltGrCtrlAlt = 'simulate altgr'; // CU SRegValue_KeyboardHotKeysAreToggle = 'hotkeys are toggles'; // CU SRegValue_ReleaseShiftKeysAfterKeyPress = 'release shift keys after key press'; // CU @@ -171,9 +167,6 @@ interface SRegValue_DeadkeyConversionMode = 'deadkey conversion mode'; // CU // I4552 SRegValue_UnderlyingLayout = 'underlying layout'; // CU -// SRegKey_AppInitDLLs = 'Software\Microsoft\Windows NT\CurrentVersion\Windows'; // LM -// SRegValue_AppInitDLLs = 'AppInit_DLLs'; // LM - SRegKey_KeyboardLayoutToggle = 'keyboard layout\toggle'; // CU // I2522 SRegValue_Toggle_Hotkey = 'Hotkey'; SRegValue_Toggle_LanguageHotkey = 'Language Hotkey'; @@ -272,10 +265,6 @@ interface SRegValue_CPIUP_CachedLanguageName = 'CachedLanguageName'; SRegValue_CPIUP_InputMethodOverride = 'InputMethodOverride'; - { User profile keys } - - //SRegKey_NTProfileList = 'Software\Microsoft\Windows NT\CurrentVersion\ProfileList'; - { Font keys } SRegKey_FontList_LM = 'Software\Microsoft\Windows\CurrentVersion\Fonts'; // LM @@ -318,13 +307,6 @@ interface SRegKey_IDETestFonts_CU = SRegKey_IDE_CU + '\TestFonts'; // CU SRegKey_IDEVisualKeyboard_CU = SRegKey_IDE_CU + '\VisualKeyboard'; // CU SRegKey_IDEToolbars_CU = SRegKey_IDE_CU + '\Toolbars'; // CU -// SRegKey_KCT = SRegKey_KeymanDeveloper_CU + '\KCT'; // LM CU -// SRegKey_KCTFiles = SRegKey_KCT_CU + '\Files'; // CU - -// SRegKey_IDEOnline = SRegKey_IDE_CU + '\Online'; // CU -// SRegKey_IDE_BrandingPackTest = SRegKey_IDE_CU + '\Branding Pack\Test'; // CU // I4873 - -// SRegKey_CRM = SRegKey_KeymanDeveloper + '\CRM'; // CU SRegValue_CheckForUpdates = 'check for updates'; // CU SRegValue_LastUpdateCheckTime = 'last update check time'; // CU @@ -335,8 +317,6 @@ interface SRegValue_KeepInTouchShown = 'keep in touch shown'; // CU. bool // I4658 - //SRegValue_OnlineUsername = 'online username'; - //SRegValue_OnlinePassword = 'online password'; SRegValue_OnlineLogin = 'online login'; { SRegKey_CRM values } @@ -349,7 +329,6 @@ interface { SRegKey_KeymanDeveloper values } - //SRegValue_ShowStartup = 'show startup'; // CU -- see Keyman option of same name SRegValue_Evaluation = 'evaluation'; // CU SRegValue_ActiveProject = 'active project'; // CU @@ -364,7 +343,6 @@ interface SRegValue_IDEMRU = 'MRU'; // CU SRegValue_CharMapSize = 'char map size'; // CU -//SRegValue_IDERegressionTestPath = 'regression test path'; // CU { SRegKey_IDEVisualKeyboard values } @@ -393,8 +371,6 @@ interface SRegValue_IDEOptAutoSaveBeforeCompiling = 'auto save before compiling'; // CU SRegValue_IDEOptOSKAutoSaveBeforeImporting = 'osk auto save before importing'; // CU - SRegValue_IDEOptUseLegacyCompiler = 'use legacy compiler'; // CU - // Note: keeping 'web host port' reg value name to ensure settings maintained // from version 14.0 and earlier of Keyman Developer. Other values are // new with Keyman Developer 15.0 @@ -409,8 +385,6 @@ interface SRegValue_IDEOptCharMapDisableDatabaseLookups = 'char map disable database lookups'; // CU SRegValue_IDEOptCharMapAutoLookup = 'char map auto lookup'; // CU - SRegValue_IDEOptMultipleInstances = 'multiple instances'; // CU - SRegValue_IDEOptOpenKeyboardFilesInSourceView = 'open keyboard files in source view'; // CU // I4751 SRegValue_IDEDisplayTheme = 'display theme'; // I4796 @@ -425,10 +399,6 @@ interface SRegValue_IDEOpt_DefaultProjectPath = 'default project path'; - { SRegKey_KCT values } - -// SRegValue_KCTTemplatePath = 'template path'; // LM - {------------------------------------------------------------------------------- - Shared keys and values - ------------------------------------------------------------------------------} diff --git a/common/windows/delphi/general/UserMessages.pas b/common/windows/delphi/general/UserMessages.pas index 9480714f0a3..0b547891490 100644 --- a/common/windows/delphi/general/UserMessages.pas +++ b/common/windows/delphi/general/UserMessages.pas @@ -42,10 +42,6 @@ interface WM_USER_CheckFonts = WM_USER + 115; const - // KeymanDeveloperUtils - WM_USER_LOADREGFILES = WM_USER+120; - //WM_USER_FORMSHOWN = WM_USER+100; - WC_COMMAND = 0; WC_HELP = 1; WC_OPENURL = 2; diff --git a/core/CORE_API_VERSION.md b/core/CORE_API_VERSION.md new file mode 100644 index 00000000000..3eefcb9dd5b --- /dev/null +++ b/core/CORE_API_VERSION.md @@ -0,0 +1 @@ +1.0.0 diff --git a/core/meson.build b/core/meson.build index 2061942d61b..716faca2dc2 100644 --- a/core/meson.build +++ b/core/meson.build @@ -12,14 +12,15 @@ project('keyman_core', 'cpp', 'c', 'cpp_std=c++14', 'b_vscrt=static_from_buildtype', 'warning_level=2'], - meson_version: '>=0.53.0') + meson_version: '>=0.57.0') # Import our standard compiler defines; this is copied from # /resources/build/standard.meson.build by build.sh, because # meson doesn't allow us to reference a file outside its root subdir('resources') -lib_version = '1.0.0' +fs = import('fs') +lib_version = fs.read('CORE_API_VERSION.md').strip() py = import('python') python = py.find_installation() diff --git a/core/tests/unit/ldml/keyboards/meson.build b/core/tests/unit/ldml/keyboards/meson.build index 89077fabaca..f4b7f23a29d 100644 --- a/core/tests/unit/ldml/keyboards/meson.build +++ b/core/tests/unit/ldml/keyboards/meson.build @@ -10,8 +10,10 @@ tests_from_cldr = [ 'ja-Latn', 'pt-t-k0-abnt2', - 'fr-t-k0-azerty', + # 'fr-t-k0-optimise', (not yet) + # 'fr-t-k0-test', 'pcm', + 'bn', ] tests_without_testdata = [ diff --git a/developer/src/kmc-kmn/build.sh b/developer/src/kmc-kmn/build.sh index 7766610ac7a..a6163d9eaf1 100755 --- a/developer/src/kmc-kmn/build.sh +++ b/developer/src/kmc-kmn/build.sh @@ -70,7 +70,11 @@ if builder_start_action test; then copy_deps tsc --build test/ npm run lint - c8 --reporter=lcov --reporter=text --exclude-after-remap mocha "${builder_extra_params[@]}" + readonly C8_THRESHOLD=70 + c8 --reporter=lcov --reporter=text --lines $C8_THRESHOLD --statements $C8_THRESHOLD --branches $C8_THRESHOLD --functions $C8_THRESHOLD mocha + builder_echo warning "Coverage thresholds are currently $C8_THRESHOLD%, which is lower than ideal." + builder_echo warning "Please increase threshold in build.sh as test coverage improves." + builder_finish_action success test fi diff --git a/developer/src/kmc-kmn/package.json b/developer/src/kmc-kmn/package.json index 5802c859055..4105c04b9e8 100644 --- a/developer/src/kmc-kmn/package.json +++ b/developer/src/kmc-kmn/package.json @@ -61,7 +61,6 @@ "exclude-after-remap": true, "exclude": [ "src/import/", - "src/kmw-compiler", "test/" ] }, diff --git a/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts b/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts index 26981f5711c..92cba914c5e 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/compiler-globals.ts @@ -46,3 +46,7 @@ export function IsKeyboardVersion14OrLater(): boolean { export function IsKeyboardVersion15OrLater(): boolean { return fk.fileVersion >= KMX.KMXFile.VERSION_150; } + +export function IsKeyboardVersion17OrLater(): boolean { + return fk.fileVersion >= KMX.KMXFile.VERSION_170; +} diff --git a/developer/src/kmc-kmn/src/kmw-compiler/javascript-strings.ts b/developer/src/kmc-kmn/src/kmw-compiler/javascript-strings.ts index 7c59f69e6f9..bafbae2794a 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/javascript-strings.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/javascript-strings.ts @@ -482,7 +482,7 @@ function JavaScript_CompositeContextValue(fk: KMX.KEYBOARD, fkp: KMX.KEY, pwsz: Cur--; // don't increment on ifsystemstore -- correlates with AdjustIndex function // I3910 break; case KMX.KMXFile.CODE_CONTEXTEX: // I3980 - Result += `k.KCCM(${Len-Cur},${Len-rec.ContextEx.Index+1},t)`; + Result += `k.KCCM(${Len-Cur},${Len-rec.ContextEx.Index},t)`; break; case KMX.KMXFile.CODE_NOTANY: // I3981 CheckStoreForInvalidFunctions(fk, fkp, rec.Any.Store); // I1520 @@ -572,7 +572,7 @@ function JavaScript_FullContextValue(fk: KMX.KEYBOARD, fkp: KMX.KEY, pwsz: strin FullContext += `{t:'a',a:this.s${JavaScript_Name(rec.Any.StoreIndex, rec.Any.Store.dpName)},n:1}`; break; case KMX.KMXFile.CODE_CONTEXTEX: - FullContext += `{t:'c',c:${rec.ContextEx.Index}}`; // I4611 + FullContext += `{t:'c',c:${rec.ContextEx.Index+1}}`; // I4611 break; case KMX.KMXFile.CODE_INDEX: FullContext += `{t:'i',i:this.s${JavaScript_Name(rec.Index.StoreIndex, rec.Index.Store.dpName)},`+ diff --git a/developer/src/kmc-kmn/src/kmw-compiler/kmw-compiler.ts b/developer/src/kmc-kmn/src/kmw-compiler/kmw-compiler.ts index 29922a492f2..2cd7e762d6f 100644 --- a/developer/src/kmc-kmn/src/kmw-compiler/kmw-compiler.ts +++ b/developer/src/kmc-kmn/src/kmw-compiler/kmw-compiler.ts @@ -1,6 +1,6 @@ import { KMX, CompilerOptions, CompilerCallbacks, KvkFileReader, VisualKeyboard, KmxFileReader, KvkFile } from "@keymanapp/common-types"; import { ExpandSentinel, incxstr, xstrlen } from "./util.js"; -import { options, nl, FTabStop, setupGlobals, IsKeyboardVersion10OrLater, callbacks, FFix183_LadderLength, FCallFunctions, fk } from "./compiler-globals.js"; +import { options, nl, FTabStop, setupGlobals, IsKeyboardVersion10OrLater, callbacks, FFix183_LadderLength, FCallFunctions, fk, IsKeyboardVersion17OrLater } from "./compiler-globals.js"; import { JavaScript_ContextMatch, JavaScript_KeyAsString, JavaScript_Name, JavaScript_OutputString, JavaScript_Rules, JavaScript_Shift, JavaScript_ShiftAsString, JavaScript_Store, zeroPadHex } from './javascript-strings.js'; import { KmwCompilerMessages } from "./kmw-compiler-messages.js"; import { ValidateLayoutFile } from "./validate-layout-file.js"; @@ -438,8 +438,13 @@ function GetKeyboardModifierBitmask(keyboard: KMX.KEYBOARD, fMnemonic: boolean): function JavaScript_SetupDebug() { if(IsKeyboardVersion10OrLater()) { if(options.saveDebug) { - return 'var modCodes = keyman.osk.modifierCodes;'+nl+ - FTabStop+'var keyCodes = keyman.osk.keyCodes;'+nl; + if(IsKeyboardVersion17OrLater()) { + return 'var modCodes = KeymanWeb.Codes.modifierCodes;'+nl+ + FTabStop+'var keyCodes = KeymanWeb.Codes.keyCodes;'+nl; + } else { + return 'var modCodes = keyman.osk.modifierCodes;'+nl+ + FTabStop+'var keyCodes = keyman.osk.keyCodes;'+nl; + } } } return ''; diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.js b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.js new file mode 100644 index 00000000000..3e401d6241c --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.js @@ -0,0 +1,54 @@ +if(typeof keyman === 'undefined') { + console.log('Keyboard requires KeymanWeb 10.0 or later'); + if(typeof tavultesoft !== 'undefined') tavultesoft.keymanweb.util.alert("This keyboard requires KeymanWeb 10.0 or later"); +} else { +KeymanWeb.KR(new Keyboard_test_context_in_context()); +} +function Keyboard_test_context_in_context() +{ + var modCodes = keyman.osk.modifierCodes; + var keyCodes = keyman.osk.keyCodes; + + this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9; + this.KI="Keyboard_test_context_in_context"; + this.KN="test context(n) in context, #9930"; + this.KMINVER="10.0"; + this.KV=null; + this.KDU=0; + this.KH=''; + this.KM=0; + this.KBVER="1.0"; + this.KMBM=modCodes.SHIFT /* 0x0010 */; + this.s_liveQwerty_6="qwerty"; + this.s_deadQwerty_7=[{t:'d',d:0},{t:'d',d:1},{t:'d',d:2},{t:'d',d:3},{t:'d',d:4},{t:'d',d:5}]; + this.KVS=[]; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.g_main_0=function(t,e) { + var k=KeymanWeb,r=0,m=0; + if(k.KKM(e, modCodes.SHIFT | modCodes.VIRTUAL_KEY /* 0x4010 */, keyCodes.K_1 /* 0x31 */)) { + if(k.KFCM(1,t,[{t:'a',a:this.s_liveQwerty_6}])){ + r=m=1; // Line 13 + k.KDC(1,t); + k.KO(-1,t,"?"); + k.KIO(-1,this.s_deadQwerty_7,1,t); + k.KIO(-1,this.s_deadQwerty_7,1,t); + } + } + else if(k.KKM(e, modCodes.VIRTUAL_KEY /* 0x4000 */, keyCodes.K_PERIOD /* 0xBE */)) { + if(k.KFCM(3,t,['?',{t:'a',a:this.s_deadQwerty_7},{t:'c',c:2}])){ + r=m=1; // Line 17 + k.KDC(3,t); + k.KO(-1,t,"("); + k.KIO(-1,this.s_liveQwerty_6,2,t); + k.KIO(-1,this.s_liveQwerty_6,2,t); + k.KO(-1,t,")"); + } + } + return r; + }; +} diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.kmn b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.kmn new file mode 100644 index 00000000000..4854ef491ce --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context.kmn @@ -0,0 +1,17 @@ +store(&VERSION) "10.0" +store(&TARGETS) 'web' +store(&NAME) 'test context(n) in context, #9930' + +begin Unicode > use(main) + +group(main) using keys + +store(liveQwerty) 'qwerty' +store(deadQwerty) dk(q) dk(w) dk(e) dk(r) dk(t) dk(y) + +c any/index with deadkeys in stores. +any(liveQwerty) + '!' > '?' index(deadQwerty, 1) index(deadQwerty, 1) + +c The rule below is misgenerated by kmc-17.0.205-alpha on `context(2)` statement; +c see https://github.com/keymanapp/keyman/issues/9930 +'?' any(deadQwerty) context(2) + '.' > '(' index(liveQwerty, 2) index(liveQwerty, 2) ')' diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.js b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.js new file mode 100644 index 00000000000..d4a6983ffe1 --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.js @@ -0,0 +1,47 @@ + +KeymanWeb.KR(new Keyboard_test_context_in_context_9()); + +function Keyboard_test_context_in_context_9() +{ + + this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9; + this.KI="Keyboard_test_context_in_context_9"; + this.KN="test context(n) in context, #9930, v9.0"; + this.KMINVER="9.0"; + this.KV=null; + this.KDU=0; + this.KH=''; + this.KM=0; + this.KBVER="1.0"; + this.KMBM=0x0010; + this.s_liveQwerty_6="qwerty"; + this.s_deadQwerty_7="123456"; + this.KVS=[]; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.g_main_0=function(t,e) { + var k=KeymanWeb,r=0,m=0; + if(k.KKM(e, 0x4010, 0x31)) { + if(k.KA(0,k.KC(1,1,t),this.s_liveQwerty_6)){ + r=m=1; // Line 13 + k.KO(1,t,"?"); + k.KIO(-1,this.s_deadQwerty_7,1,t); + k.KIO(-1,this.s_deadQwerty_7,1,t); + } + } + else if(k.KKM(e, 0x4000, 0xBE)) { + if(k.KCM(3,t,"?",1)&&k.KA(1,k.KC(2,1,t),this.s_deadQwerty_7)&&k.KCCM(1,2,t)){ + r=m=1; // Line 17 + k.KO(3,t,"("); + k.KIO(-1,this.s_liveQwerty_6,2,t); + k.KIO(-1,this.s_liveQwerty_6,2,t); + k.KO(-1,t,")"); + } + } + return r; + }; +} diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.kmn b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.kmn new file mode 100644 index 00000000000..6b06eb6cec0 --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_context_in_context_9.kmn @@ -0,0 +1,17 @@ +store(&VERSION) "9.0" +store(&TARGETS) 'web' +store(&NAME) 'test context(n) in context, #9930, v9.0' + +begin Unicode > use(main) + +group(main) using keys + +store(liveQwerty) 'qwerty' +store(deadQwerty) '123456' + +c any/index with deadkeys in stores. +any(liveQwerty) + '!' > '?' index(deadQwerty, 1) index(deadQwerty, 1) + +c The rule below is misgenerated by kmc-17.0.205-alpha on `context(2)` statement; +c see https://github.com/keymanapp/keyman/issues/9930 +'?' any(deadQwerty) context(2) + '.' > '(' index(liveQwerty, 2) index(liveQwerty, 2) ')' diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.js b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.js new file mode 100644 index 00000000000..da0c1b9477f --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.js @@ -0,0 +1,44 @@ +if(typeof keyman === 'undefined') { + console.log('Keyboard requires KeymanWeb 10.0 or later'); + if(typeof tavultesoft !== 'undefined') tavultesoft.keymanweb.util.alert("This keyboard requires KeymanWeb 10.0 or later"); +} else { +KeymanWeb.KR(new Keyboard_test_contextn_in_output()); +} +function Keyboard_test_contextn_in_output() +{ + var modCodes = keyman.osk.modifierCodes; + var keyCodes = keyman.osk.keyCodes; + + this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9; + this.KI="Keyboard_test_contextn_in_output"; + this.KN="test context(n) in output, #9930, v10.0"; + this.KMINVER="10.0"; + this.KV=null; + this.KDU=0; + this.KH=''; + this.KM=0; + this.KBVER="1.0"; + this.KMBM=modCodes.SHIFT /* 0x0010 */; + this.s_liveQwerty_6="qwerty"; + this.s_deadQwerty_7=[{t:'d',d:0},{t:'d',d:1},{t:'d',d:2},{t:'d',d:3},{t:'d',d:4},{t:'d',d:5}]; + this.KVS=[]; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.g_main_0=function(t,e) { + var k=KeymanWeb,r=0,m=0; + if(k.KKM(e, modCodes.SHIFT | modCodes.VIRTUAL_KEY /* 0x4010 */, keyCodes.K_1 /* 0x31 */)) { + if(k.KFCM(2,t,[{t:'a',a:this.s_liveQwerty_6},'1'])){ + r=m=1; // Line 13 + k.KDC(2,t); + k.KO(-1,t,"?"); + k.KIO(-1,this.s_deadQwerty_7,1,t); + k.KO(-1,t,"1"); + } + } + return r; + }; +} diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.kmn b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.kmn new file mode 100644 index 00000000000..4a34730922b --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output.kmn @@ -0,0 +1,13 @@ +store(&VERSION) "10.0" +store(&TARGETS) 'web' +store(&NAME) 'test context(n) in output, #9930, v10.0' + +begin Unicode > use(main) + +group(main) using keys + +store(liveQwerty) 'qwerty' +store(deadQwerty) dk(q) dk(w) dk(e) dk(r) dk(t) dk(y) + +c any/index with deadkeys in stores. +any(liveQwerty) '1' + '!' > '?' index(deadQwerty, 1) context(2) diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.js b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.js new file mode 100644 index 00000000000..07755dc1752 --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.js @@ -0,0 +1,38 @@ + +KeymanWeb.KR(new Keyboard_test_contextn_in_output_9()); + +function Keyboard_test_contextn_in_output_9() +{ + + this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9; + this.KI="Keyboard_test_contextn_in_output_9"; + this.KN="test context(n) in output, #9930, v9.0"; + this.KMINVER="9.0"; + this.KV=null; + this.KDU=0; + this.KH=''; + this.KM=0; + this.KBVER="1.0"; + this.KMBM=0x0010; + this.s_liveQwerty_6="qwerty"; + this.s_deadQwerty_7="123456"; + this.KVS=[]; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.gs=function(t,e) { + return this.g_main_0(t,e); + }; + this.g_main_0=function(t,e) { + var k=KeymanWeb,r=0,m=0; + if(k.KKM(e, 0x4010, 0x31)) { + if(k.KA(0,k.KC(2,1,t),this.s_liveQwerty_6)&&k.KCM(1,t,"1",1)){ + r=m=1; // Line 13 + k.KO(2,t,"?"); + k.KIO(-1,this.s_deadQwerty_7,1,t); + k.KO(-1,t,"1"); + } + } + return r; + }; +} diff --git a/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.kmn b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.kmn new file mode 100644 index 00000000000..971d11694aa --- /dev/null +++ b/developer/src/kmc-kmn/test/fixtures/kmw/test_contextn_in_output_9.kmn @@ -0,0 +1,13 @@ +store(&VERSION) "9.0" +store(&TARGETS) 'web' +store(&NAME) 'test context(n) in output, #9930, v9.0' + +begin Unicode > use(main) + +group(main) using keys + +store(liveQwerty) 'qwerty' +store(deadQwerty) '123456' + +c any/index with deadkeys in stores. +any(liveQwerty) '1' + '!' > '?' index(deadQwerty, 1) context(2) diff --git a/developer/src/kmc-kmn/test/kmw/test-kmw-compiler.ts b/developer/src/kmc-kmn/test/kmw/test-kmw-compiler.ts index 42aa489a911..a7eecda019e 100644 --- a/developer/src/kmc-kmn/test/kmw/test-kmw-compiler.ts +++ b/developer/src/kmc-kmn/test/kmw/test-kmw-compiler.ts @@ -35,11 +35,11 @@ describe('KeymanWeb Compiler', function() { callbacks.clear(); }); - it('should compile a complex keyboard', async function() { + it('should compile a complex keyboard', function() { run_test_keyboard(kmnCompiler, 'khmer_angkor'); }); - it('should handle option stores', async function() { + it('should handle option stores', function() { // // This is enough to verify that the option store is set appropriately with // KLOAD because the fixture has that code present: @@ -49,7 +49,7 @@ describe('KeymanWeb Compiler', function() { run_test_keyboard(kmnCompiler, 'test_options'); }); - it('should translate every "character style" key correctly', async function() { + it('should translate every "character style" key correctly', function() { // // This is enough to verify that every character style key is encoded in the // same way as the fixture. @@ -57,9 +57,25 @@ describe('KeymanWeb Compiler', function() { run_test_keyboard(kmnCompiler, 'test_keychars'); }); - it('should handle readonly groups', async function() { + it('should handle readonly groups', function() { run_test_keyboard(kmnCompiler, 'test_readonly_groups'); }); + + it('should handle context(n) in output of rule, v10.0 generation', function() { + run_test_keyboard(kmnCompiler, 'test_contextn_in_output'); + }); + + it('should handle context(n) in output of rule, v9.0 generation', function() { + run_test_keyboard(kmnCompiler, 'test_contextn_in_output_9'); + }); + + it('should handle context(n) in context part of rule, v9.0 generation', function() { + run_test_keyboard(kmnCompiler, 'test_context_in_context_9'); + }); + + it('should handle context(n) in context part of rule, v10.0 generation', function() { + run_test_keyboard(kmnCompiler, 'test_context_in_context'); + }); }); diff --git a/developer/src/kmcmplib/build.sh b/developer/src/kmcmplib/build.sh index 1ccd13575c4..ce1c5eed1af 100755 --- a/developer/src/kmcmplib/build.sh +++ b/developer/src/kmcmplib/build.sh @@ -47,6 +47,7 @@ Libraries will be built in 'build///src'. * : 'debug' or 'release' (see --debug flag) * All parameters after '--' are passed to meson or ninja " \ + "@/common/include" \ "clean" \ "configure" \ "build" \ diff --git a/developer/src/server/src/site/index.html b/developer/src/server/src/site/index.html index 5a4fd139a55..8147a849a46 100644 --- a/developer/src/server/src/site/index.html +++ b/developer/src/server/src/site/index.html @@ -21,7 +21,7 @@ - +