Commit graph

96 commits

Author SHA1 Message Date
Steven R. Loomis
8ea87aa828 feat(common): ldml: merge keys into key2 🙀 2023-02-16 12:29:19 -06:00
Steven R. Loomis
dd76a1fc36 feat(developer): add -T option to kmc 🙀
- -T converts testdata.xml into testdata.json

#7535
2023-02-15 17:58:52 -06:00
Steven R. Loomis
228cdd6281 feat(common): ldml read keyboard testdata 🙀
- full data test

#7535
2023-02-15 17:58:52 -06:00
Steven R. Loomis
c2556acc4a feat(common): ldml read keyboard testdata 🙀
- full data read

#7535
2023-02-15 17:58:52 -06:00
Steven R. Loomis
9a31e866df feat(common): ldml read keyboard testdata 🙀
- early scaffolding
- with some basic tests

#7535
2023-02-15 17:58:52 -06:00
Steven R. Loomis
ac2366f460 feat(core): ldml C++ updates to modifiers 🙀
- spec: change caps value to 0x100 #7533
- add a 'mod_all'  for validating valid modifier keys, plus tests
- add asserts on C++ side mapping modifiers to keyman constants
- use 'mod_all' to validate modifiers
- further fix modifier -> mod in binary

For: #7985 and related to #7533
2023-02-14 09:23:03 -06:00
Steven R. Loomis
7983fd9609 fix(developer): ldml spec: layr…mod needs to be a bitfield 🙀
- layr.layers.layer.mod needs to be a bit field just as keys.key.mod

Related to #7533
2023-02-14 09:23:03 -06:00
Steven R. Loomis
7c02ab85af feat(core): ldml C++ feature support 🙀
- make ldml.cpp print FAILED on failure especially because of https://github.com/microsoft/vscode-cpptools/issues/487
- add vkey validation (#7135)
- add disp validation
- fix: a latent bug in disp! disp.count was === vkey.count, oops. Fix and test cases.

For: #7985
2023-02-14 09:23:03 -06:00
Steven R. Loomis
a8832ea893
Merge pull request #8172 from keymanapp/feat/developer/7965-morehardware-epic-ldml
feat(common): ldml different hardware support 🙀
2023-02-07 17:06:35 -06:00
Steven R. Loomis
9d6289d420
Merge pull request #8171 from keymanapp/feat/core/7533-modifier-epic-ldml
feat(common): ldml modifier support 🙀
2023-02-07 17:05:55 -06:00
Steven R. Loomis
75fb36b9e0
Merge pull request #8143 from keymanapp/fix/common/7534-more-import-errs-epic-ldml
feat(common): ldml: import error messages from the compiler   🙀
2023-02-06 11:25:20 -06:00
Steven R. Loomis
c4f7f0eb12
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-02-06 11:24:24 -06:00
Steven R. Loomis
f74a419bc6 chore: Review comment 2023-02-03 19:03:26 -06:00
Steven R. Loomis
41f77a874c feat(common): ldml different hardware support 🙀
- add HardwareToKeymap in common/web/types
- add a mt-iso keyboard, very close to stock mt.xml
- add machinery for parsing modifier key sequences
- more test machinery
- add assertions against invalid modifier sequences

Fixes: #7965
2023-02-03 19:00:57 -06:00
Steven R. Loomis
af10312f84 feat(common): ldml modifier support 🙀
- spec: update spec for layr.mod field
- core/include/ldm: update constants
- bitfield modelled after s_modifier_names[]  / LCTRLFLAG etc.
- new test case k_004_tinyshift, also update k_010_mt
- update const builder to ignore all *_map properties
- split utility out to utils, add test

For: #7533
(cherry picked from commit 0346bea488)
2023-02-03 18:54:22 -06:00
Steven R. Loomis
6f51be0684 feat(common): ldml: unit tests for import error messages from the compiler 🙀
- test fixup

For: #7534
2023-02-03 18:54:07 -06:00
Steven R. Loomis
7ffd2b94f5 feat(common): ldml: updates to xml loading 🙀
per review comments

- exit-early on import errs

For: #7534
2023-02-03 18:43:06 -06:00
Steven R. Loomis
ac38c277d8 feat(common): ldml: comprehensive import/implied data tests 🙀
For: #7534
(cherry picked from commit 2b64006dba)
2023-02-03 18:43:06 -06:00
Steven R. Loomis
5c357fad81 feat(common): ldml: unit tests for import error messages from the compiler 🙀
- also, change loadFile in callbacks to return null when file isn't found.

For: #7534
(cherry picked from commit 33274dd2c8)
2023-02-03 18:39:51 -06:00
Steven R. Loomis
20c1f5ec9e feat(common): ldml: import error messages from the compiler 🙀
For: #7534
(cherry picked from commit 3a3729e5c6)
2023-02-03 18:38:01 -06:00
Steven R. Loomis
1f594e6cf1 fix(common): test fix for test-ldml-keyboard-xml-reader 2023-02-03 18:24:43 -06:00
Steven R. Loomis
f527caaf0b feat(common): ldml updates to validation errors 🙀
- Apply suggestions from code review
- move m() into common code
- rename several error-related fields and types
- drop the 'unknown AJV error' - we expect errors to be populated
- halt compilation if validation fails, don't press on

For: #7534

Co-authored-by: Marc Durdin <marc@durdin.net>
(cherry picked from commit 05cc200f2027ee3c61280812a2de85ef20ea8b51)
2023-02-03 18:24:43 -06:00
Steven R. Loomis
0a0a9dcc27 feat(common): ldml: error messages from the compiler 🙀
- more refactor into common/web/types
- refactor test harness
- use reportMessage instead of throwing

For: #7964
(cherry picked from commit a112b847c4)
2023-02-03 18:24:43 -06:00
Steven R. Loomis
709c1ccca5 fix(common) make common/web/types kvk tests pass 🙀
- use hexy and git-diff to show a rich diff when files are changed
- add additional round trip tests
- initialize the underlyingLayout to undefined to promote round tripping
- fix an issue with the CompilerCallbacks in the xml tests (broken in #8107)
- fix an issue with the kvk file writer where it should set strings irregardless (#7955)

Fixes #7967, again
2023-01-31 12:15:39 -06:00
Steven R. Loomis
80a001520c chore(common): imports: Apply suggestions from code review 🙀
-  rename compiler.ts to compiler-interfaces.ts

applies to 5a4b44f2d7

Co-authored-by: Marc Durdin <marc@durdin.net>

For: #7534
2023-01-30 21:04:05 -06:00
Steven R. Loomis
a40ee01767 feat(developer): ldml import/implied keys : review comment 🙀
- add a TODO comment about using a custom error class
2023-01-27 13:06:00 -06:00
Steven R. Loomis
bbd850c03b feat(common): ldml: imports: use cldr version from constants 🙀
- common: more robustness in importing.
- build: don't copy imports to kmc which doesn't need it

supports #7964
2023-01-27 12:45:00 -06:00
Steven R. Loomis
a0b184a022 feat(common): ldml: use cldr version from constants 🙀
- update several config files

supports #7964
2023-01-27 12:45:00 -06:00
Steven R. Loomis
e5c5fd025e feat(common): ldml: change importer to use callbacks for fs 🙀
supports #7964
2023-01-27 12:45:00 -06:00
Steven R. Loomis
3eb7f05df6 feat(developer): ldml implied keys work 🙀
- update test cases per review

- review comment
2023-01-27 12:42:18 -06:00
Steven R. Loomis
727056cb87 feat(developer): ldml support implied keys 🙀
- automatically add the import

Fixes: #7964

Apply suggestions from code review

Co-authored-by: Marc Durdin <marc@durdin.net>
2023-01-27 12:41:39 -06:00
Steven R. Loomis
6fd2e418bc feat(common): ldml implement imports 🙀
add tests:
- k_100, k_101, k_102 all failed for different reasons.
- rename test cases from 'fail' to 'keytest' since they don't fail anymore

For: #7401

- update k101_fail.xml / k102_fail.xml to use an implied import
- update build.sh to bring over the imports from CLDR

For #7534
2023-01-27 12:40:22 -06:00
Steven R. Loomis
5a4b44f2d7 chore(common): move CompilerEvent, CompilerCallbacks into types 🙀
- make CompilerCallbacks an interface
- concrete implementations for Node (CLI) and for Testing
- change loadFile to take a string|URL 🙀

supports #7964
2023-01-27 12:37:54 -06:00
Steven R. Loomis
592d4b0b5e
Merge pull request #7969 from keymanapp/feat/developer-7965-epic-ldml-spacebar
fix(common): update USVirtualKeyMap to actually be US🙀
2023-01-26 17:02:57 -06:00
Steven R. Loomis
70b351347a
Merge pull request #7570 from keymanapp/fix/core/7569-unicode-escaping-epic-ldml
fix(developer): ldml: fix for unescaping Unicode values 🙀
2023-01-26 14:29:17 -06:00
Steven R. Loomis
1d7e0d1922
Merge pull request #8030 from keymanapp/spec/core/7986-hardware-enum-epic-ldml
spec(core): ldml: make hardware be an enum 🙀
2023-01-26 14:05:26 -06:00
Steven R. Loomis
a1cfd7253d fix(common): update USVirtualKeyMap to actually be US🙀
comon/web/types:
- the USVirtualKeyMap was actually somewhat ISO-ish. Correct it.
- also, add the spacebar row.
- create a new ISOVirtualKeyMap, but not linked in anywhere.

core/tests:
- add a new test keyboard, k_010_mt.xml which is Maltese 47-key
- update k_003 which was impacted by this

For: #7965
2023-01-26 13:49:49 -06:00
Steven R. Loomis
e63745baff chore(coverage): ldml setup for visual code coverage 🙀
- generate coverage/lcov.info files in several places that were already using c8
- change kmc-package's 'npm test' to include coverage, leave 'coverage' as alias
- gitignore the lcov files

Fixes #8060
2023-01-20 11:22:44 -06:00
Steven R. Loomis
f02307af5b chore(common): ldml: fix test case 🙀
- I had broken this in a212aefeec
by improving the error message extracted from Ajv

For: #7967
2023-01-20 10:12:41 -06:00
Steven R. Loomis
d7ce2191bf feat(core): ldml: make hardware be an enum 🙀
For: #7986
2023-01-19 12:24:47 -06:00
Steven R. Loomis
cbb5af2ae7 feat(core): ldml: Drop padding: common,core 🙀
- also add some checking in the builder
- add a Constants.str_section_id() for debugging
- update basic.txt

For: #7987
2023-01-09 16:35:47 -06:00
Steven R. Loomis
e4799d2498
Merge pull request #7956 from keymanapp/fix/core/maqtugha
fix(core): ldml: fix spelling of maqtugħa 🙀
2023-01-07 22:54:48 -06:00
Steven R. Loomis
30865fbb1b Merge remote-tracking branch 'upstream/feature-ldml' into fix/core/7569-unicode-escaping-epic-ldml 2023-01-07 22:38:42 -06:00
Steven R. Loomis
3d154540e7 fix(common): ldml: updates per code review 🙀
- build-key2.ts: comments, and treat the kmxplus data as const
- build-layr.ts: comments, reordering of structs, and treat the kmxplus data as const
- build-list.ts: comments, reordering
- string-list.ts: comments
- kmx-plus.ts: comments
- ldml-keyboard-xml.ts: update definition of LKKey.transform
-

For #7532
2023-01-06 15:42:05 -06:00
Steven R. Loomis
564f98cc30
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-01-06 11:46:17 -06:00
Steven R. Loomis
b1191bb69e fix(developer): ldml: add escaping to key2 section 🙀
- also add functions to the ListItem class
- also fix a bug in ListItem.toString()
- add test cases

Fixes #7569
2023-01-05 16:02:08 -06:00
Steven R. Loomis
d68999e0ef fix(common): escaping: only unescape on some attributes 🙀
- keys:  key.to
- disp: display.to, display.display
- disp: displayOptions.baseCharacter

The rest will have to wait for downstream of PR #7630

For: #7569
2023-01-05 13:46:07 -06:00
Steven R. Loomis
26c91e6534 fix(common): escaping: util and test fix 🙀
- a successful regex for multi escapes. Could be optimized

For: #7965
2023-01-05 13:46:07 -06:00
Steven R. Loomis
c54c2974b8 fix(common): escaping: util and test fix 🙀
- attempt to handle multi strings. regex not workign yet

For: #7569
2023-01-05 13:46:07 -06:00
Steven R. Loomis
6d981c9482 fix(common): util and test fix 🙀
- throw rangeError on invalid codepoints
- update escapes

Thrown message: 'Out of range while unescaping '\u{110000}': Invalid code point 1114112'

For: #7965
2023-01-05 13:46:07 -06:00