diff --git a/developer/src/kmc-ldml/src/compiler/keys.ts b/developer/src/kmc-ldml/src/compiler/keys.ts index 8656e7fbf2f..9653a94920d 100644 --- a/developer/src/kmc-ldml/src/compiler/keys.ts +++ b/developer/src/kmc-ldml/src/compiler/keys.ts @@ -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) { diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-bad-modifier.xml similarity index 75% rename from developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml rename to developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-bad-modifier.xml index 29a2ba7b73c..fcb72da3922 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-bad-modifier.xml @@ -6,7 +6,7 @@ - + diff --git a/developer/src/kmc-ldml/test/keys.tests.ts b/developer/src/kmc-ldml/test/keys.tests.ts index 97171cf6fcf..b2748cdd3eb 100644 --- a/developer/src/kmc-ldml/test/keys.tests.ts +++ b/developer/src/kmc-ldml/test/keys.tests.ts @@ -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: [ diff --git a/developer/src/kmc-ldml/test/layr.tests.ts b/developer/src/kmc-ldml/test/layr.tests.ts index 64e4a3d373a..1ee67b72619 100644 --- a/developer/src/kmc-ldml/test/layr.tests.ts +++ b/developer/src/kmc-ldml/test/layr.tests.ts @@ -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',