Commit graph

138 commits

Author SHA1 Message Date
Marc Durdin
ac27082e6d chore(developer): configure before build for kmc 2022-09-09 12:14:01 +10:00
Marc Durdin
561899a2a0 refactor(developer): rename kmldmlc to kmc
Fixes #7237.

Full clean, configure and build will be required for Core, Developer
after this change.

kmc is much less unwieldy a name than kmldmlc, and becomes our platform
for future compiler integration. Start of implementation for #5283 also.
2022-09-09 09:13:39 +10:00
Marc Durdin
b6c4e21c1d chore(developer): remove name from meta section
Fixes #7214.
2022-09-09 08:57:52 +10:00
Marc Durdin
e086b8f45a
Merge pull request #7244 from keymanapp/chore/core/7134-unirename
chore(core): improve xstring macros 🙀
2022-09-09 05:22:23 +10:00
Marc Durdin
0def7dd97d
Merge pull request #7212 from keymanapp/feat/developer/kmldmlc-transform-sections
feat(developer): kmldmlc compiler for transforms 🙀
2022-09-09 05:21:54 +10:00
Steven R. Loomis
90131728e8 chore(core): improve xstring macros 🙀
- move Utf32CharToUtf16 to inline
- remove Is_SMP and call sites, use Utf32CharToUtf16 instead.

For: #7134
2022-09-08 12:29:04 -05:00
Steven R. Loomis
82443a610d
fix(core): ldml Update core/src/kmx/kmx_plus.h
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-09-08 12:04:04 -05:00
Steven R. Loomis
029a2737bf fix(core): ldml: improve utf-32 handling++ 🙀
- review comments
- kmx_xstring: add and document macros, add Utf32CharToUtf16
- unit tests for kmx_xstring macros

Fixes: #7134
2022-09-08 11:45:23 -05:00
Steven R. Loomis
7a71ed84cc fix(core): ldml: improve utf-32 handling 🙀
- remove hacky utf-32 processing
- add utf-32 test case to test_kmx_plus.cpp
- change kmx_plus to return std::u16string
- kmx_xstring: add Uni_IsBMP() macro

Fixes: #7134
2022-09-07 18:08:26 -05:00
Marc Durdin
ec5a83a3fa
Merge pull request #7204 from keymanapp/feat/core/ldml-transform-table-specs-and-constants
feat(core): ldml keyboard transform elements 🙀
2022-09-07 11:28:42 +10:00
Marc Durdin
2e7aef39e7
Merge pull request #7197 from keymanapp/chore/core/section-order
chore(core): order sections according to binary format 🙀
2022-09-07 11:27:54 +10:00
Marc Durdin
5e1d898527
Merge pull request #7196 from keymanapp/feat/core/ldml-name-section
feat(core): add 'name' section 🙀
2022-09-07 11:27:46 +10:00
Marc Durdin
f1b2be168f
Merge pull request #7193 from keymanapp/chore/core/kmxplus-zero-length-string
chore(core): define zero length string vs null string for kmxplus 🙀
2022-09-07 11:27:30 +10:00
Marc Durdin
690290bdfe
chore(core): add comment for KMXPLUS_STR
Co-authored-by: Steven R. Loomis <srl295@gmail.com>
2022-09-07 08:14:23 +10:00
Marc Durdin
8e5ce35f4d feat(developer): kmldmlc compiler and tests for transforms
Adds compilers and minimal unit tests for transform sections bksp,
finl, ordr, and tran, and cleans up problems in the corresponding
builders.

Adds a utility script for building test fixtures for manual analysis:
  ./build.sh build-fixtures

Refactors constants to give us design-time type safety once more.
2022-09-06 10:15:31 +10:00
Marc Durdin
9f5f8e976e feat(core): ldml keyboard transform elements
Adds definitions for LDML keyboard transform elements `transforms`,
`backspaces`, and `reorders`, and the binary format sections `bksp`,
`elem`, `finl`, `ordr`, and `tran`.

Minimally updates the compiler so that it will build, but no other
changes to the compiler.

Compiler and Typescript updates to support building these sections will
come in the next PR.
2022-09-05 13:11:51 +10:00
Marc Durdin
0222ed308a chore: remove extra files 2022-09-04 06:14:53 +10:00
Marc Durdin
ea6bd8f09f chore(core): order sections according to binary format
Just reorders all work around the various sections to match the binary
format order -- that is, 'sect' first, then all other sections
alphabetically.

This also means the compiler now emits the sections in the expected
order.

No other changes to functionality.
2022-09-04 06:10:34 +10:00
Marc Durdin
b17805df3a feat(core): add 'name' section
Updates compiler, headers and documentation for the 'name' section,
which will always be present as the LDML keyboard spec requires at least
one name in the `<names>` element.
2022-09-04 05:45:43 +10:00
Marc Durdin
a274a44979 chore(core): wrap text on C7043_ldml.md 2022-09-03 06:12:36 +10:00
Marc Durdin
aef38f12df chore(core): define zero length string vs null string for kmxplus 2022-09-03 06:11:24 +10:00
Marc Durdin
702db90a71 feat(core): add version field to meta
Also adds semver package for validating the version field.
2022-09-02 14:13:10 +10:00
Marc Durdin
d141274aed chore(core): update hextobin files with new format 2022-09-02 14:06:26 +10:00
Steven R. Loomis
f3f498e923 fix(core): fix validators 🙀
- copy over asserts from 'old' code

#7136
2022-08-31 17:37:55 -05:00
Steven R. Loomis
3684cc43d0 fix(core): fix validators 🙀
yes, a kmxplus file does not start with a 'sect' !

#7136
2022-08-31 17:37:55 -05:00
Steven R. Loomis
90be01385b chore(core): split out validators 🙀
#7136
2022-08-31 17:37:55 -05:00
Marc Durdin
696ae9964d
Merge pull request #7153 from keymanapp/refactor/developer/kmldmlc-pure-functional-section-compilers
refactor(developer): each section compiler is a pure function 🙀
2022-08-30 19:04:05 -05:00
Steven R. Loomis
bef0013bf8 feat(core): set -DDEBUG for debug 🙀
- set -DDEBUG for 'debug' meson builds
- default KXPLUS_DEBUG  to 1 for -DDEBUG

#7136
2022-08-30 11:49:22 -05:00
Marc Durdin
91283464ca
Merge pull request #7150 from keymanapp/chore/merge-master-feature-ldml
chore: merge master into feature-ldml 🙀
2022-08-29 20:52:44 -05:00
Marc Durdin
db11553c9a refactor(developer): each section compiler is a pure function
Well, almost. There are still callback side-effects for messages. These
may in future be returned as an array as well, eliminating the need for
a message callback.

But restructures each section compiler so that it is self-contained and
responsible only for writing its own section. Also tightens up the types
for the sections constants.

Last, but not least, moves responsibility for writing the output .kmx
out of compiler.ts and into its callers -- removing one dependency from
the compiler. Reading input files still needs to be done in the
compiler, as there may be multiple input files with `<import>` that we
cannot know about until we start parsing xml.
2022-08-30 11:13:11 +10:00
Steven R. Loomis
f03abf2ea5
Update core/src/ldml/ldml_processor.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-29 17:23:17 -05:00
Steven R. Loomis
46d7c96823 fix(core): ldml: fix validator 🙀
- allow keys section to exactly fit in data size, as in #7140
2022-08-29 17:16:45 -05:00
Steven R. Loomis
8c65dea9b3
Merge pull request #7132 from keymanapp/feat/core/5015-fileread
feat(core): ldml: improve file reading/validation 🙀
2022-08-29 16:45:56 -05:00
Steven R. Loomis
c03ab40d5d feat(core): ldml: update spec per code review
#7043
2022-08-29 16:41:39 -05:00
Steven R. Loomis
1c7188f9fd
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-29 16:41:12 -05:00
Marc Durdin
655c872dc8 chore: Merge branch 'master' into chore/merge-master-feature-ldml 2022-08-30 06:31:04 +10:00
Marc Durdin
895ce930a0
Merge pull request #6993 from keymanapp/chore/core/rename-json-source
chore(core): rename json.hpp to jsonpp.hpp 🛩
2022-08-29 14:48:32 -05:00
Marc Durdin
a72146e42d feat(developer): unit test framework for kmldmlc 2022-08-29 17:21:05 +10:00
Marc Durdin
670229937a chore: move hextobin to common 2022-08-29 15:07:43 +10:00
Marc Durdin
10b875da57 chore(core): chmod build.sh 2022-08-29 07:47:49 +10:00
Marc Durdin
3d08348256 feat(core): hextobin tool
The hextobin tool is used to help us construct invalid .kmx files
without having to either hack these into the compiler, or write them
with a hex editor. It feels a little bit of overkill, but this makes it
easy to (a) work with our intended file structures, and (b) review any
changes to these invalid keyboard tests.

Note: I did do a cursory search for a hex2bin or hextobin that we could
easily use but did not find a good simple cross-platform tool that we
could consume (`xxd -r` would work but AFAICT constrains our format to a
dump which is much harder to work with and read -- I wanted to be able
to annotate with file structures.)

For an example, see ik_000_null_invalid.txt.

This means that building the invalid keyboards for tests requires node,
but that should be fine given we need node to build the valid keyboards
anyway.

I've put hextobin under core/tools but it could just as well live under
common/tools in the future, if we find it useful for other project unit
tests.
2022-08-29 06:21:16 +10:00
Marc Durdin
9945055c00 chore(core): move and re-enable invalid ldml keyboard tests 2022-08-28 05:10:21 +10:00
Marc Durdin
0057b7d95c chore(core): emcc off path for linux 2022-08-27 14:53:06 +10:00
Marc Durdin
bc02ba984a chore(core): skip ldml keyboard tests if node not available 2022-08-27 08:47:34 +10:00
Steven R. Loomis
791d253528 feat(core): ldml: improve reading 🙀
- read keys into a std::map instead of on the fly
- remove retention of entire kmx file
- remove some functions from kmx_plus.h

#5015
2022-08-26 16:47:20 -05:00
Steven R. Loomis
3de77cda92 feat(core): ldml: improve reading 🙀
- read keys into a std::map instead of on the fly
- no longer retain copy of entire KMX file in read
2022-08-26 16:43:27 -05:00
Steven R. Loomis
892492a634 feat(core): ldml: improve validation 🙀
- clearer asserts
- validate length of data

#5015
2022-08-26 15:45:48 -05:00
Marc Durdin
44d7d5ca88 chore(core): always build deps 2022-08-27 06:23:33 +10:00
Steven R. Loomis
aeeae1c4f4 feat(core): ldml: improve read side 🙀
- don't reparse structs each time
- move validation into constructor
2022-08-26 13:15:05 -05:00
Marc Durdin
3ff5c4c46e chore(core): fix typo 2022-08-26 15:58:25 +10:00