Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions developer/src/kmc-ldml/src/compiler/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,9 @@ export class KeysCompiler extends SectionCompiler {
// Finally, kmap
// Use LayerMap + keys to generate compiled keys for hardware
const hardwareLayers = this.hardwareLayers();
/* c8 ignore next 3 */
if (hardwareLayers.length > 1) {
// validation should have already caught this
throw Error(
`Internal error: Expected 0 or 1 hardware layer, not ${hardwareLayers.length}`
);
} else if (hardwareLayers.length === 1) {
if (hardwareLayers.length >= 1) {
// Only 1 hardware layer is supported; however, `LayrCompiler` will report
// on this error, so we can just process the first one here
const theLayers = hardwareLayers[0];
const { formId } = theLayers;
for (const layer of theLayers.layer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<keys />

<layers formId="us">
<layer id="base" modifiers="altR-shift"> <!-- invalid, should be "altR shift" -->
<layer modifiers="altR-shift"> <!-- invalid, should be "altR shift" -->
<row keys="a b c" />
</layer>
</layers>
Expand Down
6 changes: 0 additions & 6 deletions developer/src/kmc-ldml/test/keys.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,6 @@ describe('keys.kmap', function () {
]);
},
},
{
subpath: 'sections/keys/invalid-bad-modifier.xml',
errors: [
LdmlCompilerMessages.Error_InvalidModifier({ modifiers: 'altR-shift' }),
]
},
{
subpath: 'sections/keys/invalid-missing-flick.xml',
errors: [
Expand Down
2 changes: 1 addition & 1 deletion developer/src/kmc-ldml/test/layr.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('layr', function () {
errors: [],
},
{
subpath: 'sections/keys/invalid-bad-modifier.xml',
subpath: 'sections/layr/invalid-bad-modifier.xml',
errors: [
LdmlCompilerMessages.Error_InvalidModifier({
modifiers: 'altR-shift',
Expand Down