Add mapping handling for array / struct

This commit is contained in:
brice.boisson
2025-11-03 22:01:53 +01:00
parent d805569ed6
commit fd305ec6bd

View File

@@ -89,10 +89,16 @@ export async function addWave(
if (choice !== 'Add') return; if (choice !== 'Add') return;
} }
if (waveMappingEnable) { const reIdentifier = tokenText.match(/^([a-zA-Z_]\w*)/);
if (globalMap.has(tokenText)) { console.log(reIdentifier);
tokenText = globalMap.get(tokenText)!; // "!" asserts it's not undefined 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 // do something with truc
tokenText = tokenText.replace(/^([a-zA-Z_]\w*)/, mappedValue);
} }
} }