From fd305ec6bd5c573d7b0d4695e0b401baf63f0eb1 Mon Sep 17 00:00:00 2001 From: "brice.boisson" Date: Mon, 3 Nov 2025 22:01:53 +0100 Subject: [PATCH] Add mapping handling for array / struct --- src/wave_editor.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/wave_editor.ts b/src/wave_editor.ts index 953842d..9d7bb37 100644 --- a/src/wave_editor.ts +++ b/src/wave_editor.ts @@ -89,10 +89,16 @@ export async function addWave( if (choice !== 'Add') return; } - if (waveMappingEnable) { - if (globalMap.has(tokenText)) { - tokenText = globalMap.get(tokenText)!; // "!" asserts it's not undefined + const reIdentifier = tokenText.match(/^([a-zA-Z_]\w*)/); + console.log(reIdentifier); + if (reIdentifier) + console.log(reIdentifier[1]); + + if (waveMappingEnable && reIdentifier) { + if (globalMap.has(reIdentifier[1])) { + const mappedValue = globalMap.get(reIdentifier[1])!; // "!" asserts it's not undefined // do something with truc + tokenText = tokenText.replace(/^([a-zA-Z_]\w*)/, mappedValue); } }