Skip to content
Snippets Groups Projects
Commit 3c38119b authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Normalize @label and @# label.

Also, remove trailing whitespace from labels (see CNW items.ref @default)
parent 230f2b8a
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -2906,9 +2906,10 @@ rescan: ...@@ -2906,9 +2906,10 @@ rescan:
l = l.replace(/^\s+/,''); l = l.replace(/^\s+/,'');
} }
obj.lines[n] = l; obj.lines[n] = l;
m = l.match(/^\s*@#([^\s;]+)/); m = l.match(/^\s*@#([^;]+)/);
if (m !== null) { if (m !== null) {
cs = m[1].toLowerCase(); cs = m[1].toLowerCase().replace(/\s*$/,'');
// SIGH... duplicates are allowed... see Stonebridge. // SIGH... duplicates are allowed... see Stonebridge.
//if (obj.section[cs] !== undefined) //if (obj.section[cs] !== undefined)
// throw new Error('Duplicate section name '+cs+' in '+fname); // throw new Error('Duplicate section name '+cs+' in '+fname);
...@@ -2920,11 +2921,13 @@ rescan: ...@@ -2920,11 +2921,13 @@ rescan:
// Labels *can* have spaces in them (see extitems.ref) // Labels *can* have spaces in them (see extitems.ref)
m = l.match(/^\s*@label\s+([^;]+)/i); m = l.match(/^\s*@label\s+([^;]+)/i);
if (m !== null) { if (m !== null) {
var lab = m[1].toLowerCase(); var lab = m[1].toLowerCase().replace(/\s*$/,'');
// SIGH... duplicates are allowed... see Stonebridge. // SIGH... duplicates are allowed... see Stonebridge.
//if (obj.section[lab] !== undefined) //if (obj.section[lab] !== undefined)
// throw new Error('Duplicate label name '+lab+' in section '+cs+' in '+fname); // throw new Error('Duplicate label name '+lab+' in section '+cs+' in '+fname);
obj.section[lab] = {line:n}; // But the *FIRST* match is the right one!
if (obj.section[cs] === undefined)
obj.section[cs] = {line:n};
return; return;
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment