@sasjs/lint 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -4
- package/package.json +1 -1
- package/rules/file/noUndeclaredMacros.js +15 -3
- package/rules/file/noUndeclaredMacros.js.map +1 -1
- package/rules/file/noUnusedMacros.js +15 -7
- package/rules/file/noUnusedMacros.js.map +1 -1
- package/sasjslint-schema.json +12 -2
- package/types/LintConfig.d.ts +1 -0
- package/types/LintConfig.js +28 -1
- package/types/LintConfig.js.map +1 -1
- package/utils/defaultIgnoredMacros.d.ts +7 -0
- package/utils/defaultIgnoredMacros.js +11 -0
- package/utils/defaultIgnoredMacros.js.map +1 -0
- package/utils/getLintConfig.d.ts +1 -0
- package/utils/getLintConfig.js +2 -0
- package/utils/getLintConfig.js.map +1 -1
- package/utils/headerMacros.d.ts +22 -6
- package/utils/headerMacros.js +135 -43
- package/utils/headerMacros.js.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/index.js.map +1 -1
- package/utils/parseMacroCalls.d.ts +24 -3
- package/utils/parseMacroCalls.js +64 -4
- package/utils/parseMacroCalls.js.map +1 -1
package/README.md
CHANGED
|
@@ -29,6 +29,7 @@ Configuration is via a `.sasjslint` file with the following structure (these are
|
|
|
29
29
|
"hasRequiredMacroOptions": false,
|
|
30
30
|
"ignoreList": [],
|
|
31
31
|
"ignoredLibnames": [],
|
|
32
|
+
"ignoredMacros": ["webout"],
|
|
32
33
|
"indentationMultiple": 2,
|
|
33
34
|
"lineEndings": "off",
|
|
34
35
|
"lowerCaseFileNames": true,
|
|
@@ -117,7 +118,15 @@ The default header is as follows:
|
|
|
117
118
|
**/
|
|
118
119
|
```
|
|
119
120
|
|
|
120
|
-
A blank line separates the `<h4> SAS Macros </h4>` section from the header content before it and from whatever follows the list.
|
|
121
|
+
A blank line separates the `<h4> SAS Macros </h4>` section from the header content before it and from whatever follows the list.
|
|
122
|
+
|
|
123
|
+
`<h4> SAS Macros </h4>` is the compile dependency list: `sasjs compile` reads it and inlines each macro as precode, so an entry is a file the build resolves. It is the only header list this linter reads, and every other `<h4>` list in the header (`SAS Includes`, `Binary Files`, `SAS Programs`, `Service Inputs`, `Service Outputs`, ...) is left entirely alone.
|
|
124
|
+
|
|
125
|
+
Each entry is the tag and one file token - `@li mf_trim.sas` - indented to the same width as the section tag; nothing may follow the token. The extension is dropped to give the macro name, so `@li mp_as` is read as `mp_as` too. A line carrying anything after the file token is not an entry: prose belongs on its own line, and a section that carries such a line is left as its author wrote it rather than being rewritten or having the line removed. The section is machine-maintained, so text after the token would be lost on the next rewrite anyway.
|
|
126
|
+
|
|
127
|
+
A tag one slip away from `@li` (`@il`, `@l1`, `@1i`) is read as an entry, so a typo cannot hide the declarations below it - and because such a line is read, nothing reports it, so the formatter writes every entry back as `@li <file>` at the section's indentation. The repair edits the entry lines in place, so it adds no blank lines and moves nothing else in the header.
|
|
128
|
+
|
|
129
|
+
A line that opens with any other tag - `@example`, `@param` - ends the list rather than being read or converted. The entries above it are still readable and still rewritable, so the formatter keeps adding and removing entries above that line and leaves the rest of the header alone.
|
|
121
130
|
|
|
122
131
|
If creating a new value, use `{lineEnding}` instead of `\n`, eg as follows:
|
|
123
132
|
|
|
@@ -182,6 +191,23 @@ A single file can add to this list with the `ignoredLibnames` key of its [`@sasj
|
|
|
182
191
|
- Default: []
|
|
183
192
|
- Used by: `noUnusedLibnames`
|
|
184
193
|
|
|
194
|
+
### ignoredMacros
|
|
195
|
+
|
|
196
|
+
The macros that `noUndeclaredMacros` treats as declared. `%webout` is the common entry: `sasjs compile` injects it into every service and no macro file provides it - `sasjs/core` carries `mv_webout` / `ms_webout` / `mm_webout`, never `webout` - so there is nothing to declare, and `sasjs lint fix` would write an `@li webout.sas` the compiler cannot find. That is why `webout` is the default entry:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"ignoredMacros": ["webout"]
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
The names are matched case-insensitively. A macro listed here is not reported, and `sasjs lint fix` does not add it to a header. An explicit list replaces the default, so `"ignoredMacros": []` reports `webout` like any other undeclared name.
|
|
205
|
+
|
|
206
|
+
A single file can add to this list with the `ignoredMacros` key of its [`@sasjslint`](#per-file-overrides) header block.
|
|
207
|
+
|
|
208
|
+
- Default: ["webout"]
|
|
209
|
+
- Used by: `noUndeclaredMacros`
|
|
210
|
+
|
|
185
211
|
### indentationMultiple
|
|
186
212
|
|
|
187
213
|
This will check each line to ensure that the count of leading spaces can be divided cleanly by this multiple.
|
|
@@ -344,9 +370,11 @@ This will highlight lines with trailing spaces. Trailing spaces serve no useful
|
|
|
344
370
|
|
|
345
371
|
### noUndeclaredMacros
|
|
346
372
|
|
|
347
|
-
SASjs programs declare the macros they use in the `<h4> SAS Macros </h4>` section of the header, so that the compiler can assemble the job before it runs. This rule reports a warning for each macro that a file invokes without declaring it - either by defining it in the file, or by listing it
|
|
373
|
+
SASjs programs declare the macros they use in the `<h4> SAS Macros </h4>` section of the header, so that the compiler can assemble the job before it runs. This rule reports a warning for each macro that a file invokes without declaring it - either by defining it in the file, or by listing it in the `<h4> SAS Macros </h4>` section. That is the only header list `sasjs compile` reads, so it is the only one that makes a macro available to the job; entries anywhere else in the header do not count.
|
|
348
374
|
|
|
349
|
-
The macros that ship with SAS (`%scan`, `%index`, `%sysfunc` and the other macro functions, along with the macro language keywords such as `%if`, `%then` and `%do`) are always considered declared, so they are never reported. That list is generated from the `macroStatements` and `macroFunctions` groups of `@sasjs/sas-language` (`npm run generate:macros`), so it tracks the SAS language data rather than being maintained here. Macros made available through the `SASAUTOS` system option are not visible to the linter and will be reported.
|
|
375
|
+
The macros that ship with SAS (`%scan`, `%index`, `%sysfunc` and the other macro functions, along with the macro language keywords such as `%if`, `%then` and `%do`) are always considered declared, so they are never reported. That list is generated from the `macroStatements` and `macroFunctions` groups of `@sasjs/sas-language` (`npm run generate:macros`), so it tracks the SAS language data rather than being maintained here. Macros made available through the `SASAUTOS` system option are not visible to the linter and will be reported - list them in [`ignoredMacros`](#ignoredmacros), which carries `webout` by default.
|
|
376
|
+
|
|
377
|
+
An invocation written inside the argument of `%str` / `%nrstr` is not reported. A file masks a trigger to print it as often as to defer it, and nothing runs at that point, so a warning there would land on text that may never be code. [`noUnusedMacros`](#nounusedmacros) counts such a name as a use, so the deferred form - `%mp_abort(iftrue=%str(%mf_existds(work.x)=1))` - satisfies the declaration it depends on without demanding one.
|
|
350
378
|
|
|
351
379
|
The warning is resolved by adding the macro name to the header. Running `sasjs lint fix` (or saving in the SASjs VS Code extension with `formatOnSave`) adds the missing macros automatically, as a unique list sorted alphabetically.
|
|
352
380
|
|
|
@@ -403,7 +431,9 @@ The counterpart of `noUndeclaredMacros`. This rule reports a warning for each ma
|
|
|
403
431
|
|
|
404
432
|
A macro can be referenced indirectly - for example by another macro in the dependency chain, or through a dynamic `%¯o` call - without appearing as a direct invocation in the file, so the warning is advisory.
|
|
405
433
|
|
|
406
|
-
|
|
434
|
+
An invocation written inside the argument of `%str` / `%nrstr` counts as a use. That text is data while the masking function runs, but its caller normally unquotes it - `%mp_abort(iftrue=%str(%mf_existds(work.x)=1))` resolves `%mf_existds` when `%mp_abort` evaluates the condition - so the declaration is a dependency of the file, and treating it as unused would have the formatter delete it.
|
|
435
|
+
|
|
436
|
+
Running `sasjs lint fix` (or saving in the SASjs VS Code extension with `formatOnSave`) removes the unused entries from the header. Together with `noUndeclaredMacros`, this leaves the `<h4> SAS Macros </h4>` section listing exactly the macros the file uses. The pass that reads the list also writes each entry back as `@li <macro>.sas` at the section's indentation, in place and without re-spacing the header, so a mistyped tag (`@il`) is repaired even when no entry is removed.
|
|
407
437
|
|
|
408
438
|
- Default: true
|
|
409
439
|
- Severity: WARNING
|
package/package.json
CHANGED
|
@@ -10,12 +10,21 @@ const parseMacros_1 = require("../../utils/parseMacros");
|
|
|
10
10
|
const sasMacros_1 = require("../../utils/sasMacros");
|
|
11
11
|
const name = 'noUndeclaredMacros';
|
|
12
12
|
const description = 'Enforce that every macro used in a file is declared.';
|
|
13
|
-
const message = `Macro '{macro}' is not declared - add it to the <h4> SAS Macros </h4>
|
|
13
|
+
const message = `Macro '{macro}' is not declared - add it to the <h4> SAS Macros </h4> section of the header, or list the macro in 'ignoredMacros'`;
|
|
14
14
|
/**
|
|
15
15
|
* Collects the first invocation of each macro that the file uses but does not
|
|
16
16
|
* declare. A macro is declared when it is defined in the file, or listed in the
|
|
17
|
-
* `<h4> SAS Macros </h4>`
|
|
18
|
-
*
|
|
17
|
+
* `<h4> SAS Macros </h4>` section of its header - the only header list that
|
|
18
|
+
* `sasjs compile` reads.
|
|
19
|
+
* Macros that ship with SAS are always considered declared, and so are the
|
|
20
|
+
* names the configuration lists in `ignoredMacros` - a macro such as `%webout`
|
|
21
|
+
* has no file to point at.
|
|
22
|
+
*
|
|
23
|
+
* The scan leaves out the argument of `%str` / `%nrstr`: a file that masks a
|
|
24
|
+
* trigger usually does so to print it, and reporting it would be a new warning
|
|
25
|
+
* on text that never runs at that point. `noUnusedMacros` counts those names,
|
|
26
|
+
* which is the conservative direction - a deferred invocation satisfies a
|
|
27
|
+
* declaration without ever demanding one.
|
|
19
28
|
*/
|
|
20
29
|
const getUndeclaredCalls = (value, config) => {
|
|
21
30
|
if (!value)
|
|
@@ -28,6 +37,7 @@ const getUndeclaredCalls = (value, config) => {
|
|
|
28
37
|
(0, headerMacros_1.getHeaderMacros)(value, config).forEach((macro) => {
|
|
29
38
|
declared.add(macro.name.toLowerCase());
|
|
30
39
|
});
|
|
40
|
+
const ignored = new Set(config.ignoredMacros.map((macro) => macro.trim().toLowerCase()));
|
|
31
41
|
const undeclared = [];
|
|
32
42
|
const seen = new Set();
|
|
33
43
|
(0, parseMacroCalls_1.parseMacroCalls)(value, config).forEach((call) => {
|
|
@@ -37,6 +47,8 @@ const getUndeclaredCalls = (value, config) => {
|
|
|
37
47
|
seen.add(key);
|
|
38
48
|
if ((0, sasMacros_1.isSasMacro)(call.name))
|
|
39
49
|
return;
|
|
50
|
+
if (ignored.has(key))
|
|
51
|
+
return;
|
|
40
52
|
if (declared.has(key))
|
|
41
53
|
return;
|
|
42
54
|
undeclared.push(call);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUndeclaredMacros.js","sourceRoot":"","sources":["../../../src/rules/file/noUndeclaredMacros.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,2DAA6E;AAC7E,iEAAwE;AACxE,yDAAqD;AACrD,qDAAkD;AAElD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AACjC,MAAM,WAAW,GAAG,sDAAsD,CAAA;AAC1E,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"noUndeclaredMacros.js","sourceRoot":"","sources":["../../../src/rules/file/noUndeclaredMacros.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,2DAA6E;AAC7E,iEAAwE;AACxE,yDAAqD;AACrD,qDAAkD;AAElD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AACjC,MAAM,WAAW,GAAG,sDAAsD,CAAA;AAC1E,MAAM,OAAO,GAAG,mIAAmI,CAAA;AAEnJ;;;;;;;;;;;;;;GAcG;AACH,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAE,MAAkB,EAAe,EAAE;IAC5E,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAElC,IAAA,yBAAW,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC3C,IAAI,KAAK,CAAC,IAAI;YAAE,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IACxD,CAAC,CAAC,CAAA;IAEF,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;IAE5D,OAAO,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC;QAC9C,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,QAAQ;KACT,CAAC,CAAC,CAAA;AACL,CAAC,CAAA;AAED,MAAM,GAAG,GAAG,CAAC,KAAa,EAAE,MAAmB,EAAU,EAAE;IACzD,MAAM,GAAG,GAAG,MAAM,IAAI,IAAI,kBAAU,EAAE,CAAA;IACtC,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEtE,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,KAAK,CAAA;IAEhC,OAAO,IAAA,gCAAiB,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAA;AAC9C,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
|
@@ -13,16 +13,20 @@ const message = `Macro '{macro}' is declared in the <h4> SAS Macros </h4> sectio
|
|
|
13
13
|
* Collects the macros declared in the `<h4> SAS Macros </h4>` section that the
|
|
14
14
|
* file itself never invokes. A macro that appears more than once is reported
|
|
15
15
|
* once, at its first entry.
|
|
16
|
+
*
|
|
17
|
+
* The scan includes the argument of `%str` / `%nrstr`, because that text is
|
|
18
|
+
* usually unquoted by its caller and the invocation runs: the guard idiom
|
|
19
|
+
* `%mp_abort(iftrue=%str(%mf_existds(work.x)=1))` resolves `%mf_existds` when
|
|
20
|
+
* `%mp_abort` evaluates the condition. Counting it as unused would report a
|
|
21
|
+
* declaration the file depends on - and the formatter would then delete it.
|
|
16
22
|
*/
|
|
17
23
|
const getUnusedMacros = (value, config) => {
|
|
18
24
|
if (!value)
|
|
19
25
|
return [];
|
|
20
|
-
const used = new Set((0, parseMacroCalls_1.parseMacroCalls)(value, config).map((call) => call.name.toLowerCase()));
|
|
26
|
+
const used = new Set((0, parseMacroCalls_1.parseMacroCalls)(value, config, { includeMasked: true }).map((call) => call.name.toLowerCase()));
|
|
21
27
|
const unused = [];
|
|
22
28
|
const reported = new Set();
|
|
23
|
-
(0, headerMacros_1.getHeaderMacros)(value, config)
|
|
24
|
-
.filter((macro) => macro.section === 'sasMacros')
|
|
25
|
-
.forEach((macro) => {
|
|
29
|
+
(0, headerMacros_1.getHeaderMacros)(value, config).forEach((macro) => {
|
|
26
30
|
const key = macro.name.toLowerCase();
|
|
27
31
|
if (reported.has(key))
|
|
28
32
|
return;
|
|
@@ -47,9 +51,13 @@ const test = (value, config) => {
|
|
|
47
51
|
const fix = (value, config) => {
|
|
48
52
|
const cfg = config || new types_1.LintConfig();
|
|
49
53
|
const macros = getUnusedMacros(value, cfg).map((macro) => macro.name);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
const removed = macros.length
|
|
55
|
+
? (0, headerMacros_1.removeMacrosFromHeader)(value, cfg, macros)
|
|
56
|
+
: value;
|
|
57
|
+
// The list is normalised even when nothing is removed: a mistyped `@li` tag
|
|
58
|
+
// or a stray indentation is read as a declaration, so no diagnostic points
|
|
59
|
+
// at it and no other pass would repair it.
|
|
60
|
+
return (0, headerMacros_1.repairHeaderList)(removed, cfg);
|
|
53
61
|
};
|
|
54
62
|
/**
|
|
55
63
|
* Lint rule that reports macros declared in the `<h4> SAS Macros </h4>` section
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noUnusedMacros.js","sourceRoot":"","sources":["../../../src/rules/file/noUnusedMacros.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"noUnusedMacros.js","sourceRoot":"","sources":["../../../src/rules/file/noUnusedMacros.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,2DAKiC;AACjC,iEAA6D;AAE7D,MAAM,IAAI,GAAG,gBAAgB,CAAA;AAC7B,MAAM,WAAW,GACf,yFAAyF,CAAA;AAC3F,MAAM,OAAO,GAAG,2FAA2F,CAAA;AAE3G;;;;;;;;;;GAUG;AACH,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,MAAkB,EAAiB,EAAE;IAC3E,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAA;IAErB,MAAM,IAAI,GAAG,IAAI,GAAG,CAClB,IAAA,iCAAe,EAAC,KAAK,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACnE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CACxB,CACF,CAAA;IAED,MAAM,MAAM,GAAkB,EAAE,CAAA;IAChC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;IAElC,IAAA,8BAAe,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC/C,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAA;QACpC,IAAI,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAM;QAC7B,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACjB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAM;QAEzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpB,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,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
package/sasjslint-schema.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"hasRequiredMacroOptions": false,
|
|
14
14
|
"ignoreList": [],
|
|
15
15
|
"ignoredLibnames": [],
|
|
16
|
+
"ignoredMacros": ["webout"],
|
|
16
17
|
"indentationMultiple": 2,
|
|
17
18
|
"lineEndings": "off",
|
|
18
19
|
"lowerCaseFileNames": true,
|
|
@@ -57,7 +58,8 @@
|
|
|
57
58
|
"strictMacroDefinition": true,
|
|
58
59
|
"ignoreList": ["sajsbuild", "sasjsresults"],
|
|
59
60
|
"hasRequiredMacroOptions": false,
|
|
60
|
-
"requiredMacroOptions": []
|
|
61
|
+
"requiredMacroOptions": [],
|
|
62
|
+
"ignoredMacros": ["webout"]
|
|
61
63
|
}
|
|
62
64
|
],
|
|
63
65
|
"properties": {
|
|
@@ -205,7 +207,7 @@
|
|
|
205
207
|
"$id": "#/properties/noUndeclaredMacros",
|
|
206
208
|
"type": "boolean",
|
|
207
209
|
"title": "noUndeclaredMacros",
|
|
208
|
-
"description": "Reports a warning for each macro a file invokes without declaring it in the `<h4> SAS Macros </h4>`
|
|
210
|
+
"description": "Reports a warning for each macro a file invokes without declaring it in the `<h4> SAS Macros </h4>` section of the header - the only header list `sasjs compile` reads. Macros that ship with SAS are always considered declared, and so are the macros listed in `ignoredMacros` (`webout` by default). The formatter resolves the warning by adding the macro names to the header, sorted alphabetically.",
|
|
209
211
|
"default": true,
|
|
210
212
|
"examples": [true, false]
|
|
211
213
|
},
|
|
@@ -258,6 +260,14 @@
|
|
|
258
260
|
"default": [],
|
|
259
261
|
"examples": [["outData", "TESTWORK"]]
|
|
260
262
|
},
|
|
263
|
+
"ignoredMacros": {
|
|
264
|
+
"$id": "#/properties/ignoredMacros",
|
|
265
|
+
"type": "array",
|
|
266
|
+
"title": "ignoredMacros",
|
|
267
|
+
"description": "An array of macros that `noUndeclaredMacros` treats as declared: an entry is neither reported nor added to the header by the formatter. Use it for macros that no file in the project provides - the default entry, `webout`, is injected by `sasjs compile`. An explicit list replaces the default. A single file can add to this list with the `ignoredMacros` key of its `@sasjslint` header block.",
|
|
268
|
+
"default": ["webout"],
|
|
269
|
+
"examples": [["webout", "mpeinit"]]
|
|
270
|
+
},
|
|
261
271
|
"hasRequiredMacroOptions": {
|
|
262
272
|
"$id": "#/properties/hasRequiredMacroOptions",
|
|
263
273
|
"type": "boolean",
|
package/types/LintConfig.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class LintConfig {
|
|
|
27
27
|
};
|
|
28
28
|
readonly requiredMacroOptions: string[];
|
|
29
29
|
readonly ignoredLibnames: string[];
|
|
30
|
+
readonly ignoredMacros: string[];
|
|
30
31
|
constructor(json?: any);
|
|
31
32
|
/**
|
|
32
33
|
* Returns a new configuration with an override merged over this one, so a
|
package/types/LintConfig.js
CHANGED
|
@@ -31,6 +31,7 @@ class LintConfig {
|
|
|
31
31
|
this.severityLevel = {};
|
|
32
32
|
this.requiredMacroOptions = [];
|
|
33
33
|
this.ignoredLibnames = [];
|
|
34
|
+
this.ignoredMacros = [];
|
|
34
35
|
this.source = json !== null && json !== void 0 ? json : {};
|
|
35
36
|
if (json === null || json === void 0 ? void 0 : json.ignoreList) {
|
|
36
37
|
if (Array.isArray(json.ignoreList)) {
|
|
@@ -45,6 +46,24 @@ class LintConfig {
|
|
|
45
46
|
throw new Error(`Property "ignoreList" can only be an array of strings`);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
// An absent setting falls back to the documented default. An explicit list
|
|
50
|
+
// replaces it, so `[]` reports `webout` like any other undeclared name.
|
|
51
|
+
if ((json === null || json === void 0 ? void 0 : json.ignoredMacros) === undefined) {
|
|
52
|
+
this.ignoredMacros.push(...utils_1.defaultIgnoredMacros);
|
|
53
|
+
}
|
|
54
|
+
else if (!Array.isArray(json.ignoredMacros)) {
|
|
55
|
+
throw new Error(`Property "ignoredMacros" can only be an array of strings.`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
json.ignoredMacros.forEach((item) => {
|
|
59
|
+
if (typeof item === 'string') {
|
|
60
|
+
this.ignoredMacros.push(item);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
throw new Error(`Property "ignoredMacros" has invalid type of values. It can only contain strings.`);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
48
67
|
if ((json === null || json === void 0 ? void 0 : json.noTrailingSpaces) !== false) {
|
|
49
68
|
this.lineLintRules.push(line_1.noTrailingSpaces);
|
|
50
69
|
}
|
|
@@ -183,7 +202,15 @@ class LintConfig {
|
|
|
183
202
|
* @returns {LintConfig} a new configuration; this one is unchanged.
|
|
184
203
|
*/
|
|
185
204
|
override(json) {
|
|
186
|
-
|
|
205
|
+
const source = Object.assign({}, this.source);
|
|
206
|
+
// Arrays whose documented default is not empty are seeded into the base
|
|
207
|
+
// before the merge. A per-file override is additive, and the project json
|
|
208
|
+
// usually leaves such a key out rather than restating the default - without
|
|
209
|
+
// the seed, an override that adds one entry would drop the rest.
|
|
210
|
+
if (source.ignoredMacros === undefined) {
|
|
211
|
+
source.ignoredMacros = [...this.ignoredMacros];
|
|
212
|
+
}
|
|
213
|
+
return new LintConfig((0, mergeLintConfig_1.mergeLintConfig)(source, json));
|
|
187
214
|
}
|
|
188
215
|
}
|
|
189
216
|
exports.LintConfig = LintConfig;
|
package/types/LintConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,wCAYsB;AACtB,wCAOsB;AACtB,wCAAuE;AACvE,+CAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,wCAYsB;AACtB,wCAOsB;AACtB,wCAA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+
/**
|
|
2
|
+
* The default value of the `ignoredMacros` setting. `sasjs compile` injects
|
|
3
|
+
* `%webout` into every service, and no macro file provides it - `sasjs/core`
|
|
4
|
+
* carries `mv_webout` / `ms_webout` / `mm_webout`, never `webout` - so declaring
|
|
5
|
+
* it would hand the compiler a dependency it cannot resolve.
|
|
6
|
+
*/
|
|
7
|
+
export declare const defaultIgnoredMacros: string[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultIgnoredMacros = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The default value of the `ignoredMacros` setting. `sasjs compile` injects
|
|
6
|
+
* `%webout` into every service, and no macro file provides it - `sasjs/core`
|
|
7
|
+
* carries `mv_webout` / `ms_webout` / `mm_webout`, never `webout` - so declaring
|
|
8
|
+
* it would hand the compiler a dependency it cannot resolve.
|
|
9
|
+
*/
|
|
10
|
+
exports.defaultIgnoredMacros = ['webout'];
|
|
11
|
+
//# sourceMappingURL=defaultIgnoredMacros.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultIgnoredMacros.js","sourceRoot":"","sources":["../../src/utils/defaultIgnoredMacros.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACU,QAAA,oBAAoB,GAAG,CAAC,QAAQ,CAAC,CAAA"}
|
package/utils/getLintConfig.d.ts
CHANGED
package/utils/getLintConfig.js
CHANGED
|
@@ -20,6 +20,7 @@ const LintConfig_1 = require("../types/LintConfig");
|
|
|
20
20
|
const file_1 = require("@sasjs/utils/file");
|
|
21
21
|
const getProjectRoot_1 = require("./getProjectRoot");
|
|
22
22
|
const LineEndings_1 = require("../types/LineEndings");
|
|
23
|
+
const defaultIgnoredMacros_1 = require("./defaultIgnoredMacros");
|
|
23
24
|
const getDefaultHeader = () => `/**{lineEnding} @file{lineEnding} @brief <Your brief here>{lineEnding}{lineEnding} <h4> SAS Macros </h4>{lineEnding}{lineEnding}**/`;
|
|
24
25
|
exports.getDefaultHeader = getDefaultHeader;
|
|
25
26
|
/**
|
|
@@ -39,6 +40,7 @@ exports.DefaultLintConfiguration = {
|
|
|
39
40
|
hasRequiredMacroOptions: false,
|
|
40
41
|
ignoreList: [],
|
|
41
42
|
ignoredLibnames: [],
|
|
43
|
+
ignoredMacros: [...defaultIgnoredMacros_1.defaultIgnoredMacros],
|
|
42
44
|
indentationMultiple: 2,
|
|
43
45
|
lineEndings: LineEndings_1.LineEndings.OFF,
|
|
44
46
|
lowerCaseFileNames: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"getLintConfig.js","sourceRoot":"","sources":["../../src/utils/getLintConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAuDA,sCASC;AAhED,gDAAuB;AACvB,4CAAmB;AACnB,oDAAgD;AAChD,4CAA4C;AAC5C,qDAAiD;AACjD,sDAAkD;AAClD,iEAA6D;AAEtD,MAAM,gBAAgB,GAAG,GAAG,EAAE,CACnC,wIAAwI,CAAA;AAD7H,QAAA,gBAAgB,oBAC6G;AAE1I;;;;;;;GAOG;AACU,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,IAAA,wBAAgB,GAAE;IACjC,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;IACzB,uBAAuB,EAAE,KAAK;IAC9B,UAAU,EAAE,EAAE;IACd,eAAe,EAAE,EAAE;IACnB,aAAa,EAAE,CAAC,GAAG,2CAAoB,CAAC;IACxC,mBAAmB,EAAE,CAAC;IACtB,WAAW,EAAE,yBAAW,CAAC,GAAG;IAC5B,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,EAAE;IACrB,mBAAmB,EAAE,EAAE;IACvB,aAAa,EAAE,EAAE;IACjB,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,cAAc,EAAE,IAAI;IACpB,wBAAwB,EAAE,KAAK;IAC/B,mBAAmB,EAAE,IAAI;IACzB,MAAM,EAAE,IAAI;IACZ,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,gBAAgB,EAAE,KAAK;IACvB,cAAc,EAAE,IAAI;IACpB,oBAAoB,EAAE,EAAE;IACxB,aAAa,EAAE,EAAE;IACjB,qBAAqB,EAAE,IAAI;CAC5B,CAAA;AAED;;;;GAIG;AACH,SAAsB,aAAa;;QACjC,MAAM,WAAW,GAAG,MAAM,IAAA,+BAAc,GAAE,CAAA;QAC1C,MAAM,gBAAgB,GAAG,WAAW,IAAI,YAAE,CAAC,OAAO,EAAE,CAAA;QACpD,MAAM,aAAa,GAAG,MAAM,IAAA,eAAQ,EAClC,cAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAC1C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACZ,OAAO,IAAI,CAAC,SAAS,CAAC,gCAAwB,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAA;IAClD,CAAC;CAAA"}
|
package/utils/headerMacros.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { LintConfig } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* A macro that is declared in the
|
|
4
|
-
* its `@li` entry.
|
|
3
|
+
* A macro that is declared in the `<h4> SAS Macros </h4>` section of a header,
|
|
4
|
+
* along with the position of its `@li` entry.
|
|
5
5
|
*/
|
|
6
6
|
export interface HeaderMacro {
|
|
7
7
|
name: string;
|
|
8
8
|
lineNumber: number;
|
|
9
9
|
startColumnNumber: number;
|
|
10
10
|
endColumnNumber: number;
|
|
11
|
-
section: 'sasMacros' | 'otherMacros';
|
|
12
11
|
}
|
|
13
12
|
/**
|
|
14
|
-
* Reads the macros declared in the
|
|
15
|
-
*
|
|
13
|
+
* Reads the macros declared in the `<h4> SAS Macros </h4>` section of a file
|
|
14
|
+
* header - the compile dependencies, and the only list `sasjs compile` reads.
|
|
16
15
|
* @param {string} text - the text content of the file.
|
|
17
16
|
* @param {LintConfig} config - the lint configuration, used for line endings.
|
|
18
17
|
* @returns {HeaderMacro[]} the declared macros, in the order they appear.
|
|
@@ -33,6 +32,22 @@ export declare const getHeaderMacros: (text: string, config?: LintConfig) => Hea
|
|
|
33
32
|
* @returns {string} the updated text content.
|
|
34
33
|
*/
|
|
35
34
|
export declare const addMacrosToHeader: (text: string, config: LintConfig, macros: string[]) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Writes the entries of the `<h4> SAS Macros </h4>` section back in their
|
|
37
|
+
* canonical shape, in place: `@li <file>` at the section's indentation.
|
|
38
|
+
*
|
|
39
|
+
* A mistyped tag (`@il`) and an entry indented to a different width are both
|
|
40
|
+
* read as declarations, so no diagnostic points at them and no other pass
|
|
41
|
+
* would touch them - this is the pass that repairs them. It edits only the
|
|
42
|
+
* lines whose text differs, so it never adds or removes a line, never re-spaces
|
|
43
|
+
* the section, and returns the text unchanged when there is nothing to repair
|
|
44
|
+
* or when the section cannot be rewritten safely.
|
|
45
|
+
*
|
|
46
|
+
* @param {string} text - the text content of the file.
|
|
47
|
+
* @param {LintConfig} config - the lint configuration, used for line endings.
|
|
48
|
+
* @returns {string} the updated text content.
|
|
49
|
+
*/
|
|
50
|
+
export declare const repairHeaderList: (text: string, config: LintConfig) => string;
|
|
36
51
|
/**
|
|
37
52
|
* Removes macro names from the `<h4> SAS Macros </h4>` section of a file
|
|
38
53
|
* header. The section header itself is kept, so an empty list remains a valid
|
|
@@ -41,7 +56,8 @@ export declare const addMacrosToHeader: (text: string, config: LintConfig, macro
|
|
|
41
56
|
*
|
|
42
57
|
* The file is returned unchanged when it has no Doxygen header, when the header
|
|
43
58
|
* has no `SAS Macros` section, when the section cannot be rewritten safely, or
|
|
44
|
-
* when none of the named macros are listed.
|
|
59
|
+
* when none of the named macros are listed. Normalising the entries is the job
|
|
60
|
+
* of `repairHeaderList`.
|
|
45
61
|
*
|
|
46
62
|
* @param {string} text - the text content of the file.
|
|
47
63
|
* @param {LintConfig} config - the lint configuration, used for line endings.
|
package/utils/headerMacros.js
CHANGED
|
@@ -1,20 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeMacrosFromHeader = exports.addMacrosToHeader = exports.getHeaderMacros = void 0;
|
|
3
|
+
exports.removeMacrosFromHeader = exports.repairHeaderList = exports.addMacrosToHeader = exports.getHeaderMacros = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const LineEndings_1 = require("../types/LineEndings");
|
|
6
6
|
const getHeaderLinesCount_1 = require("./getHeaderLinesCount");
|
|
7
7
|
const splitText_1 = require("./splitText");
|
|
8
8
|
const sasMacrosHeader = /<h4>\s*SAS Macros\s*<\/h4>/i;
|
|
9
|
-
const otherMacrosHeader = /<h4>\s*Other Macros\s*<\/h4>/i;
|
|
10
9
|
const anyHeader = /<h4>/i;
|
|
11
10
|
const headerTag = '</h4>';
|
|
12
|
-
const listItem = /^(\s
|
|
11
|
+
const listItem = /^(\s*@\s*)(\w+)(\s+)(\S+)(.*)$/;
|
|
12
|
+
const lineTag = /^\s*@\s*(\w+)(?:\s|$)/;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
|
|
14
|
+
* The tags read as an entry: `li` itself, and the single-character slips that
|
|
15
|
+
* turn it into `il`, `l1` or `1i`. A line opening with any other tag is not an
|
|
16
|
+
* entry, and it is never converted into a macro declaration.
|
|
17
|
+
*/
|
|
18
|
+
const entryTags = new Set(['li', 'il', 'l1', '1i']);
|
|
19
|
+
/** The tag a line opens with, lowercased, or `null` for a line with none. */
|
|
20
|
+
const getLineTag = (line) => {
|
|
21
|
+
const match = lineTag.exec(line);
|
|
22
|
+
return match ? match[1].toLowerCase() : null;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Reads an entry, returning the macro name, the file token after the tag, and
|
|
26
|
+
* the column at which the name starts. The column is derived from the entry
|
|
27
|
+
* text rather than from a search for the name, so an entry such as `@li li.sas`
|
|
28
|
+
* reports the `li` after the tag, not the `li` inside it.
|
|
29
|
+
*
|
|
30
|
+
* The entry is the tag and one file token, and nothing after the token: the
|
|
31
|
+
* section is maintained by the formatter, and reading prose as a declaration is
|
|
32
|
+
* how a sentence on an `@li` line ends up rewritten or removed as an unused
|
|
33
|
+
* entry.
|
|
34
|
+
*
|
|
35
|
+
* A tag one slip away from `li` is read the same way, so `@il mf_a.sas` - the
|
|
36
|
+
* commonest way to mistype the tag - is a declaration rather than the end of
|
|
37
|
+
* the list. The formatter writes such an entry back with `@li`, so the typo is
|
|
38
|
+
* repaired instead of being reported forever or silently truncating the list.
|
|
18
39
|
*
|
|
19
40
|
* @param {string} text - the line, or the tail of a line, to read.
|
|
20
41
|
* @param {number} offset - the 0-based column at which `text` starts in the
|
|
@@ -24,30 +45,46 @@ const parseListItem = (text, offset = 0) => {
|
|
|
24
45
|
const match = listItem.exec(text);
|
|
25
46
|
if (!match)
|
|
26
47
|
return null;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
48
|
+
const [, prefix, tag, gap, payload, tail] = match;
|
|
49
|
+
if (!entryTags.has(tag.toLowerCase()))
|
|
50
|
+
return null;
|
|
51
|
+
if (tail.trim() !== '')
|
|
52
|
+
return null;
|
|
53
|
+
const normalised = payload.replace(/\\/g, '/');
|
|
30
54
|
const fileName = normalised.split('/').pop() || '';
|
|
31
55
|
const name = fileName.replace(/\.sas$/i, '');
|
|
32
56
|
if (!name)
|
|
33
57
|
return null;
|
|
34
|
-
const tokenOffset = entry.indexOf(firstToken);
|
|
35
58
|
const fileOffset = normalised.lastIndexOf('/') + 1;
|
|
36
|
-
const column = offset +
|
|
37
|
-
return { name, column };
|
|
59
|
+
const column = offset + prefix.length + tag.length + gap.length + fileOffset + 1;
|
|
60
|
+
return { name, payload, column };
|
|
38
61
|
};
|
|
39
62
|
/**
|
|
40
63
|
* Reads the `@li` entries of a section that starts at `sectionIndex`.
|
|
41
64
|
*
|
|
42
|
-
* A blank line ends the list unless the next non-blank line
|
|
43
|
-
* so a list broken up by a stray blank line is still read in full -
|
|
44
|
-
* formatter rewrites exactly the lines it read, and an entry it did not
|
|
45
|
-
* would be left behind and duplicated.
|
|
65
|
+
* A blank line ends the list unless the next non-blank line opens with an
|
|
66
|
+
* entry tag, so a list broken up by a stray blank line is still read in full -
|
|
67
|
+
* the formatter rewrites exactly the lines it read, and an entry it did not
|
|
68
|
+
* read would be left behind and duplicated.
|
|
69
|
+
*
|
|
70
|
+
* A line that opens with an entry tag but cannot be read as one - `@li` with no
|
|
71
|
+
* file, or a file followed by other words - does not end the list: the scan
|
|
72
|
+
* records it and keeps reading, so one unreadable line cannot hide the
|
|
73
|
+
* declarations below it. The section then cannot be rewritten safely, because
|
|
74
|
+
* the rewrite would replace the span that line sits in.
|
|
46
75
|
*
|
|
47
|
-
*
|
|
76
|
+
* Any other line ends the list, including one that opens with an unrelated tag
|
|
77
|
+
* (`@example`, `@param`). The entries above it are still readable and still
|
|
78
|
+
* rewritable, so the formatter keeps maintaining the list it understands and
|
|
79
|
+
* leaves the rest of the header alone.
|
|
80
|
+
*
|
|
81
|
+
* @param {number} limit - the last line index the header can occupy.
|
|
82
|
+
* @returns the entries, the index of the first line after the last one, and
|
|
83
|
+
* the indices of the entry-tagged lines the scan could not read.
|
|
48
84
|
*/
|
|
49
85
|
const readSectionList = (lines, sectionIndex, limit) => {
|
|
50
86
|
const entries = [];
|
|
87
|
+
const malformed = [];
|
|
51
88
|
let end = sectionIndex + 1;
|
|
52
89
|
let index = sectionIndex + 1;
|
|
53
90
|
while (index < limit && index < lines.length) {
|
|
@@ -57,29 +94,36 @@ const readSectionList = (lines, sectionIndex, limit) => {
|
|
|
57
94
|
while (next < limit && next < lines.length && lines[next].trim() === '') {
|
|
58
95
|
next++;
|
|
59
96
|
}
|
|
60
|
-
|
|
97
|
+
const tag = next < limit && next < lines.length ? getLineTag(lines[next]) : null;
|
|
98
|
+
if (tag && entryTags.has(tag)) {
|
|
61
99
|
index = next;
|
|
62
100
|
continue;
|
|
63
101
|
}
|
|
64
102
|
break;
|
|
65
103
|
}
|
|
66
104
|
const parsed = parseListItem(line);
|
|
67
|
-
if (!parsed)
|
|
68
|
-
|
|
105
|
+
if (!parsed) {
|
|
106
|
+
const tag = getLineTag(line);
|
|
107
|
+
if (!tag || !entryTags.has(tag))
|
|
108
|
+
break;
|
|
109
|
+
malformed.push(index);
|
|
110
|
+
index++;
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
69
113
|
entries.push({
|
|
70
114
|
name: parsed.name,
|
|
71
|
-
|
|
115
|
+
payload: parsed.payload,
|
|
72
116
|
lineNumber: index + 1,
|
|
73
117
|
column: parsed.column
|
|
74
118
|
});
|
|
75
119
|
index++;
|
|
76
120
|
end = index;
|
|
77
121
|
}
|
|
78
|
-
return { entries, end };
|
|
122
|
+
return { entries, end, malformed };
|
|
79
123
|
};
|
|
80
124
|
/**
|
|
81
|
-
* Reads the macros declared in the
|
|
82
|
-
*
|
|
125
|
+
* Reads the macros declared in the `<h4> SAS Macros </h4>` section of a file
|
|
126
|
+
* header - the compile dependencies, and the only list `sasjs compile` reads.
|
|
83
127
|
* @param {string} text - the text content of the file.
|
|
84
128
|
* @param {LintConfig} config - the lint configuration, used for line endings.
|
|
85
129
|
* @returns {HeaderMacro[]} the declared macros, in the order they appear.
|
|
@@ -95,12 +139,7 @@ const getHeaderMacros = (text, config) => {
|
|
|
95
139
|
const macros = [];
|
|
96
140
|
for (let index = 0; index < headerLinesCount && index < lines.length; index++) {
|
|
97
141
|
const line = lines[index];
|
|
98
|
-
|
|
99
|
-
? 'sasMacros'
|
|
100
|
-
: otherMacrosHeader.test(line)
|
|
101
|
-
? 'otherMacros'
|
|
102
|
-
: null;
|
|
103
|
-
if (!section)
|
|
142
|
+
if (!sasMacrosHeader.test(line))
|
|
104
143
|
continue;
|
|
105
144
|
// An entry can share the line with the section tag.
|
|
106
145
|
const tagEnd = line.indexOf(headerTag) + headerTag.length;
|
|
@@ -110,8 +149,7 @@ const getHeaderMacros = (text, config) => {
|
|
|
110
149
|
name: trailing.name,
|
|
111
150
|
lineNumber: index + 1,
|
|
112
151
|
startColumnNumber: trailing.column,
|
|
113
|
-
endColumnNumber: trailing.column + trailing.name.length
|
|
114
|
-
section
|
|
152
|
+
endColumnNumber: trailing.column + trailing.name.length
|
|
115
153
|
});
|
|
116
154
|
}
|
|
117
155
|
readSectionList(lines, index, headerLinesCount).entries.forEach((entry) => {
|
|
@@ -119,8 +157,7 @@ const getHeaderMacros = (text, config) => {
|
|
|
119
157
|
name: entry.name,
|
|
120
158
|
lineNumber: entry.lineNumber,
|
|
121
159
|
startColumnNumber: entry.column,
|
|
122
|
-
endColumnNumber: entry.column + entry.name.length
|
|
123
|
-
section
|
|
160
|
+
endColumnNumber: entry.column + entry.name.length
|
|
124
161
|
});
|
|
125
162
|
});
|
|
126
163
|
}
|
|
@@ -159,8 +196,9 @@ const withSectionSpacing = (lines, sectionIndex, listEnd) => {
|
|
|
159
196
|
*
|
|
160
197
|
* Returns `null` when the section is absent, and `null` when it cannot be
|
|
161
198
|
* rewritten without disturbing the surrounding text: when the section shares a
|
|
162
|
-
* line with the header's closing `**`,
|
|
163
|
-
* with the section tag
|
|
199
|
+
* line with the header's closing `**`, when an `@li` entry shares the line
|
|
200
|
+
* with the section tag, or when the list carries a line the reader could not
|
|
201
|
+
* turn into an entry. In those cases the caller leaves the file alone, so a
|
|
164
202
|
* warning that cannot be resolved is preferable to a corrupted header.
|
|
165
203
|
*/
|
|
166
204
|
const findSasMacrosSection = (lines, headerLinesCount) => {
|
|
@@ -178,9 +216,20 @@ const findSasMacrosSection = (lines, headerLinesCount) => {
|
|
|
178
216
|
const tagEnd = lines[sectionIndex].indexOf(headerTag) + headerTag.length;
|
|
179
217
|
if (parseListItem(lines[sectionIndex].slice(tagEnd)))
|
|
180
218
|
return null;
|
|
181
|
-
const { entries, end } = readSectionList(lines, sectionIndex, headerLinesCount);
|
|
219
|
+
const { entries, end, malformed } = readSectionList(lines, sectionIndex, headerLinesCount);
|
|
220
|
+
// An unreadable line sits inside the span the rewrite replaces, so rewriting
|
|
221
|
+
// would delete it. Leave the section to its author instead.
|
|
222
|
+
if (malformed.length)
|
|
223
|
+
return null;
|
|
182
224
|
return { sectionIndex, entries, end };
|
|
183
225
|
};
|
|
226
|
+
/**
|
|
227
|
+
* Writes an entry back to a header line. The tag is always `@li`, the payload
|
|
228
|
+
* is the single file token the reader accepted, and the indentation is the
|
|
229
|
+
* section's - so a mistyped tag (`@il`) and entries indented to a different
|
|
230
|
+
* width are repaired by the same pass that rewrites the list.
|
|
231
|
+
*/
|
|
232
|
+
const formatEntry = (entry, indent) => `${indent}@li ${entry.payload}`;
|
|
184
233
|
/**
|
|
185
234
|
* Adds macro names to the `<h4> SAS Macros </h4>` section of a file header,
|
|
186
235
|
* merging them with the entries that are already listed, de-duplicating by
|
|
@@ -231,17 +280,17 @@ const addMacrosToHeader = (text, config, macros) => {
|
|
|
231
280
|
entries.forEach((entry) => {
|
|
232
281
|
const key = entry.name.toLowerCase();
|
|
233
282
|
if (!byName.has(key))
|
|
234
|
-
byName.set(key, { name: entry.name,
|
|
283
|
+
byName.set(key, { name: entry.name, payload: entry.payload });
|
|
235
284
|
});
|
|
236
285
|
macros.forEach((macro) => {
|
|
237
286
|
const key = macro.toLowerCase();
|
|
238
287
|
if (byName.has(key))
|
|
239
288
|
return;
|
|
240
|
-
byName.set(key, { name: macro,
|
|
289
|
+
byName.set(key, { name: macro, payload: `${macro}.sas` });
|
|
241
290
|
});
|
|
242
291
|
const sortedLines = [...byName.values()]
|
|
243
292
|
.sort((a, b) => compareMacroNames(a.name, b.name))
|
|
244
|
-
.map((entry) => entry.
|
|
293
|
+
.map((entry) => `${indent}@li ${entry.payload}`);
|
|
245
294
|
const result = [
|
|
246
295
|
...lines.slice(0, sectionIndex + 1),
|
|
247
296
|
...sortedLines,
|
|
@@ -250,6 +299,47 @@ const addMacrosToHeader = (text, config, macros) => {
|
|
|
250
299
|
return withSectionSpacing(result, sectionIndex, sectionIndex + 1 + sortedLines.length).join(lineEnding);
|
|
251
300
|
};
|
|
252
301
|
exports.addMacrosToHeader = addMacrosToHeader;
|
|
302
|
+
/**
|
|
303
|
+
* Writes the entries of the `<h4> SAS Macros </h4>` section back in their
|
|
304
|
+
* canonical shape, in place: `@li <file>` at the section's indentation.
|
|
305
|
+
*
|
|
306
|
+
* A mistyped tag (`@il`) and an entry indented to a different width are both
|
|
307
|
+
* read as declarations, so no diagnostic points at them and no other pass
|
|
308
|
+
* would touch them - this is the pass that repairs them. It edits only the
|
|
309
|
+
* lines whose text differs, so it never adds or removes a line, never re-spaces
|
|
310
|
+
* the section, and returns the text unchanged when there is nothing to repair
|
|
311
|
+
* or when the section cannot be rewritten safely.
|
|
312
|
+
*
|
|
313
|
+
* @param {string} text - the text content of the file.
|
|
314
|
+
* @param {LintConfig} config - the lint configuration, used for line endings.
|
|
315
|
+
* @returns {string} the updated text content.
|
|
316
|
+
*/
|
|
317
|
+
const repairHeaderList = (text, config) => {
|
|
318
|
+
if (!text)
|
|
319
|
+
return text;
|
|
320
|
+
const headerLinesCount = (0, getHeaderLinesCount_1.getHeaderLinesCount)(text, config);
|
|
321
|
+
if (!headerLinesCount)
|
|
322
|
+
return text;
|
|
323
|
+
const lines = (0, splitText_1.splitText)(text, config);
|
|
324
|
+
const section = findSasMacrosSection(lines, headerLinesCount);
|
|
325
|
+
if (!section)
|
|
326
|
+
return text;
|
|
327
|
+
const { sectionIndex, entries } = section;
|
|
328
|
+
const indent = lines[sectionIndex].match(/^\s*/)[0];
|
|
329
|
+
const lineEnding = config.lineEndings === LineEndings_1.LineEndings.CRLF ? '\r\n' : '\n';
|
|
330
|
+
const repaired = [...lines];
|
|
331
|
+
let changed = false;
|
|
332
|
+
entries.forEach((entry) => {
|
|
333
|
+
const index = entry.lineNumber - 1;
|
|
334
|
+
const formatted = formatEntry(entry, indent);
|
|
335
|
+
if (lines[index] === formatted)
|
|
336
|
+
return;
|
|
337
|
+
repaired[index] = formatted;
|
|
338
|
+
changed = true;
|
|
339
|
+
});
|
|
340
|
+
return changed ? repaired.join(lineEnding) : text;
|
|
341
|
+
};
|
|
342
|
+
exports.repairHeaderList = repairHeaderList;
|
|
253
343
|
/**
|
|
254
344
|
* Removes macro names from the `<h4> SAS Macros </h4>` section of a file
|
|
255
345
|
* header. The section header itself is kept, so an empty list remains a valid
|
|
@@ -258,7 +348,8 @@ exports.addMacrosToHeader = addMacrosToHeader;
|
|
|
258
348
|
*
|
|
259
349
|
* The file is returned unchanged when it has no Doxygen header, when the header
|
|
260
350
|
* has no `SAS Macros` section, when the section cannot be rewritten safely, or
|
|
261
|
-
* when none of the named macros are listed.
|
|
351
|
+
* when none of the named macros are listed. Normalising the entries is the job
|
|
352
|
+
* of `repairHeaderList`.
|
|
262
353
|
*
|
|
263
354
|
* @param {string} text - the text content of the file.
|
|
264
355
|
* @param {LintConfig} config - the lint configuration, used for line endings.
|
|
@@ -277,6 +368,7 @@ const removeMacrosFromHeader = (text, config, macros) => {
|
|
|
277
368
|
if (!section)
|
|
278
369
|
return text;
|
|
279
370
|
const { sectionIndex, entries, end } = section;
|
|
371
|
+
const indent = lines[sectionIndex].match(/^\s*/)[0];
|
|
280
372
|
const remove = new Set(macros.map((macro) => macro.toLowerCase()));
|
|
281
373
|
const kept = [];
|
|
282
374
|
const seen = new Set();
|
|
@@ -293,7 +385,7 @@ const removeMacrosFromHeader = (text, config, macros) => {
|
|
|
293
385
|
return;
|
|
294
386
|
}
|
|
295
387
|
seen.add(key);
|
|
296
|
-
kept.push(entry
|
|
388
|
+
kept.push(formatEntry(entry, indent));
|
|
297
389
|
});
|
|
298
390
|
if (!changed)
|
|
299
391
|
return text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headerMacros.js","sourceRoot":"","sources":["../../src/utils/headerMacros.ts"],"names":[],"mappings":";;;AAAA,oCAAqC;AACrC,sDAAkD;AAClD,+DAA2D;AAC3D,2CAAuC;AAuBvC,MAAM,eAAe,GAAG,6BAA6B,CAAA;AACrD,MAAM,iBAAiB,GAAG,+BAA+B,CAAA;AACzD,MAAM,SAAS,GAAG,OAAO,CAAA;AACzB,MAAM,SAAS,GAAG,OAAO,CAAA;AACzB,MAAM,QAAQ,GAAG,yBAAyB,CAAA;AAE1C;;;;;;;;;GASG;AACH,MAAM,aAAa,GAAG,CACpB,IAAY,EACZ,MAAM,GAAG,CAAC,EAC+B,EAAE;IAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;IACtB,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;IAErD,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;IACjD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAA;IAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IAC5C,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IAC7C,MAAM,U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G,IAAI;QACP,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;KACpB,CAAA;IAED,OAAO,kBAAkB,CACvB,MAAM,EACN,YAAY,EACZ,YAAY,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAC/B,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AACpB,CAAC,CAAA;AAnDY,QAAA,sBAAsB,0BAmDlC;AAED,MAAM,iBAAiB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CACzD,CAAC,CAAC,WAAW,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAA"}
|
package/utils/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './splitLines';
|
|
|
9
9
|
export * from './getIndicesOf';
|
|
10
10
|
export * from './getHeaderLinesCount';
|
|
11
11
|
export * from './getDataSectionsDetail';
|
|
12
|
+
export * from './defaultIgnoredMacros';
|
|
12
13
|
export * from './headerMacros';
|
|
13
14
|
export * from './mergeLintConfig';
|
|
14
15
|
export * from './parseLibnames';
|
package/utils/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __exportStar(require("./splitLines"), exports);
|
|
|
25
25
|
__exportStar(require("./getIndicesOf"), exports);
|
|
26
26
|
__exportStar(require("./getHeaderLinesCount"), exports);
|
|
27
27
|
__exportStar(require("./getDataSectionsDetail"), exports);
|
|
28
|
+
__exportStar(require("./defaultIgnoredMacros"), exports);
|
|
28
29
|
__exportStar(require("./headerMacros"), exports);
|
|
29
30
|
__exportStar(require("./mergeLintConfig"), exports);
|
|
30
31
|
__exportStar(require("./parseLibnames"), exports);
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,sDAAmC;AACnC,8CAA2B;AAC3B,iDAA8B;AAC9B,8CAA2B;AAC3B,+CAA4B;AAC5B,iDAA8B;AAC9B,wDAAqC;AACrC,0DAAuC;AACvC,iDAA8B;AAC9B,oDAAiC;AACjC,kDAA+B;AAC/B,sDAAmC;AACnC,oDAAiC;AACjC,8CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B;AAC9B,kDAA+B;AAC/B,mDAAgC;AAChC,sDAAmC;AACnC,8CAA2B;AAC3B,iDAA8B;AAC9B,8CAA2B;AAC3B,+CAA4B;AAC5B,iDAA8B;AAC9B,wDAAqC;AACrC,0DAAuC;AACvC,yDAAsC;AACtC,iDAA8B;AAC9B,oDAAiC;AACjC,kDAA+B;AAC/B,sDAAmC;AACnC,oDAAiC;AACjC,8CAA2B"}
|
|
@@ -8,14 +8,32 @@ export interface MacroCall {
|
|
|
8
8
|
startColumnNumber: number;
|
|
9
9
|
endColumnNumber: number;
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Options for the scan.
|
|
13
|
+
*/
|
|
14
|
+
export interface MacroCallScanOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Reports the invocations written inside the argument of a masking function
|
|
17
|
+
* (`%str` / `%nrstr`).
|
|
18
|
+
*
|
|
19
|
+
* The argument is text while the masking function runs, but the caller
|
|
20
|
+
* normally unquotes it later: `%mp_assert(iftrue=%str(%mf_existds(work.x)=1))`
|
|
21
|
+
* resolves `%mf_existds` when `%mp_assert` evaluates the condition. A caller
|
|
22
|
+
* that asks which macros a file uses - the `noUnusedMacros` side - sets this.
|
|
23
|
+
* A caller that asks which macros a file invokes in open code leaves it off,
|
|
24
|
+
* so text a file masks only in order to print it is not reported.
|
|
25
|
+
*/
|
|
26
|
+
includeMasked?: boolean;
|
|
27
|
+
}
|
|
11
28
|
/**
|
|
12
29
|
* Finds the macro invocations in a file.
|
|
13
30
|
*
|
|
14
31
|
* SAS resolves macro triggers inside double-quoted strings but not inside
|
|
15
32
|
* single-quoted strings, so a double-quoted string is scanned as code while a
|
|
16
33
|
* single-quoted string is opaque. Invocations inside block comments, macro
|
|
17
|
-
* comments, comment statements,
|
|
18
|
-
*
|
|
34
|
+
* comments, comment statements, data sections and embedded-language `submit`
|
|
35
|
+
* blocks are excluded. The argument of a masking function (`%str` / `%nrstr`)
|
|
36
|
+
* is excluded unless the caller asks for it with `includeMasked`.
|
|
19
37
|
*
|
|
20
38
|
* Every `%name` token is reported, including the macro language keywords and
|
|
21
39
|
* the macros that ship with SAS. Callers decide which names are interesting.
|
|
@@ -23,6 +41,9 @@ export interface MacroCall {
|
|
|
23
41
|
* @param {string} text - the text content to scan.
|
|
24
42
|
* @param {LintConfig} config - the lint configuration. It is accepted for
|
|
25
43
|
* symmetry with the other utilities and is not used by the scan.
|
|
44
|
+
* @param {MacroCallScanOptions} options - how much of the masked text to scan.
|
|
45
|
+
* The default skips the argument of a masking function; `includeMasked` scans
|
|
46
|
+
* it for invocations.
|
|
26
47
|
* @returns {MacroCall[]} the invocations, in the order they appear.
|
|
27
48
|
*/
|
|
28
|
-
export declare const parseMacroCalls: (text: string, config?: LintConfig) => MacroCall[];
|
|
49
|
+
export declare const parseMacroCalls: (text: string, config?: LintConfig, options?: MacroCallScanOptions) => MacroCall[];
|
package/utils/parseMacroCalls.js
CHANGED
|
@@ -12,14 +12,49 @@ const embeddedLanguageProc = /^proc\s+(lua|groovy)\b/i;
|
|
|
12
12
|
/** Matches the statement that closes an embedded-language block. */
|
|
13
13
|
const embeddedLanguageEnd = /^endsubmit\s*;/i;
|
|
14
14
|
const embeddedLanguageEndSearch = /endsubmit/i;
|
|
15
|
+
/**
|
|
16
|
+
* Finds the `%name` tokens inside the argument of a masking function.
|
|
17
|
+
*
|
|
18
|
+
* The argument is masked text rather than code, so a quote or a comment marker
|
|
19
|
+
* in it opens nothing. The scan therefore recognises only the escapes
|
|
20
|
+
* `%(` / `%)` and a `%name` token, and it does not report a `%name:` label.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} text - the whole file.
|
|
23
|
+
* @param {number} from - the offset at which the argument starts.
|
|
24
|
+
* @param {number} to - the offset at which it ends.
|
|
25
|
+
* @returns {{ name: string; offset: number }[]} the tokens, in order.
|
|
26
|
+
*/
|
|
27
|
+
const findMaskedCalls = (text, from, to) => {
|
|
28
|
+
const tokens = [];
|
|
29
|
+
let index = from;
|
|
30
|
+
while (index < to) {
|
|
31
|
+
if (text[index] === '%') {
|
|
32
|
+
if (text[index + 1] === '(' || text[index + 1] === ')') {
|
|
33
|
+
index += 2;
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const macroName = macroNameStart.exec(text.slice(index, to));
|
|
37
|
+
if (macroName) {
|
|
38
|
+
if (text[index + macroName[0].length] !== ':') {
|
|
39
|
+
tokens.push({ name: macroName[1], offset: index });
|
|
40
|
+
}
|
|
41
|
+
index += macroName[0].length;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
index++;
|
|
46
|
+
}
|
|
47
|
+
return tokens;
|
|
48
|
+
};
|
|
15
49
|
/**
|
|
16
50
|
* Finds the macro invocations in a file.
|
|
17
51
|
*
|
|
18
52
|
* SAS resolves macro triggers inside double-quoted strings but not inside
|
|
19
53
|
* single-quoted strings, so a double-quoted string is scanned as code while a
|
|
20
54
|
* single-quoted string is opaque. Invocations inside block comments, macro
|
|
21
|
-
* comments, comment statements,
|
|
22
|
-
*
|
|
55
|
+
* comments, comment statements, data sections and embedded-language `submit`
|
|
56
|
+
* blocks are excluded. The argument of a masking function (`%str` / `%nrstr`)
|
|
57
|
+
* is excluded unless the caller asks for it with `includeMasked`.
|
|
23
58
|
*
|
|
24
59
|
* Every `%name` token is reported, including the macro language keywords and
|
|
25
60
|
* the macros that ship with SAS. Callers decide which names are interesting.
|
|
@@ -27,9 +62,12 @@ const embeddedLanguageEndSearch = /endsubmit/i;
|
|
|
27
62
|
* @param {string} text - the text content to scan.
|
|
28
63
|
* @param {LintConfig} config - the lint configuration. It is accepted for
|
|
29
64
|
* symmetry with the other utilities and is not used by the scan.
|
|
65
|
+
* @param {MacroCallScanOptions} options - how much of the masked text to scan.
|
|
66
|
+
* The default skips the argument of a masking function; `includeMasked` scans
|
|
67
|
+
* it for invocations.
|
|
30
68
|
* @returns {MacroCall[]} the invocations, in the order they appear.
|
|
31
69
|
*/
|
|
32
|
-
const parseMacroCalls = (text, config) => {
|
|
70
|
+
const parseMacroCalls = (text, config, options) => {
|
|
33
71
|
const calls = [];
|
|
34
72
|
if (!text)
|
|
35
73
|
return calls;
|
|
@@ -131,9 +169,13 @@ const parseMacroCalls = (text, config) => {
|
|
|
131
169
|
}
|
|
132
170
|
// Masking functions - the argument is data, not code. `%(` and `%)` are
|
|
133
171
|
// the escapes for literal parentheses inside the argument, so they do
|
|
134
|
-
// not affect the nesting depth.
|
|
172
|
+
// not affect the nesting depth. When the caller asks for masked text,
|
|
173
|
+
// the function name is skipped and the argument is scanned in place, so
|
|
174
|
+
// an invocation the file defers is still reported at its own position.
|
|
135
175
|
const maskingFunction = maskingFunctionStart.exec(text.slice(index));
|
|
136
176
|
if (maskingFunction) {
|
|
177
|
+
// The extent of the argument comes from the parenthesis depth, with
|
|
178
|
+
// `%(` and `%)` treated as escapes rather than as delimiters.
|
|
137
179
|
let depth = 0;
|
|
138
180
|
let end = index + maskingFunction[0].length - 1;
|
|
139
181
|
while (end < length) {
|
|
@@ -153,6 +195,24 @@ const parseMacroCalls = (text, config) => {
|
|
|
153
195
|
}
|
|
154
196
|
end++;
|
|
155
197
|
}
|
|
198
|
+
if (options === null || options === void 0 ? void 0 : options.includeMasked) {
|
|
199
|
+
// The argument is scanned for `%name` tokens only, never as code: a
|
|
200
|
+
// quote or a comment marker in it is data to SAS, and letting one
|
|
201
|
+
// open a string or a comment here would swallow the invocations that
|
|
202
|
+
// follow - which under-counts uses, the direction that makes the
|
|
203
|
+
// formatter delete a declaration the file needs.
|
|
204
|
+
const argumentStart = index + maskingFunction[0].length;
|
|
205
|
+
advanceTo(argumentStart);
|
|
206
|
+
findMaskedCalls(text, argumentStart, end).forEach((token) => {
|
|
207
|
+
advanceTo(token.offset);
|
|
208
|
+
calls.push({
|
|
209
|
+
name: token.name,
|
|
210
|
+
lineNumber,
|
|
211
|
+
startColumnNumber: columnNumber,
|
|
212
|
+
endColumnNumber: columnNumber + 1 + token.name.length
|
|
213
|
+
});
|
|
214
|
+
});
|
|
215
|
+
}
|
|
156
216
|
advanceTo(end);
|
|
157
217
|
atStatementStart = false;
|
|
158
218
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseMacroCalls.js","sourceRoot":"","sources":["../../src/utils/parseMacroCalls.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"parseMacroCalls.js","sourceRoot":"","sources":["../../src/utils/parseMacroCalls.ts"],"names":[],"mappings":";;;AA8BA,oEAAoE;AACpE,MAAM,cAAc,GAAG,uBAAuB,CAAA;AAE9C,uDAAuD;AACvD,MAAM,gBAAgB,GAAG,yCAAyC,CAAA;AAElE,qEAAqE;AACrE,MAAM,oBAAoB,GAAG,qBAAqB,CAAA;AAElD,0EAA0E;AAC1E,MAAM,oBAAoB,GAAG,yBAAyB,CAAA;AAEtD,oEAAoE;AACpE,MAAM,mBAAmB,GAAG,iBAAiB,CAAA;AAC7C,MAAM,yBAAyB,GAAG,YAAY,CAAA;AAE9C;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAG,CACtB,IAAY,EACZ,IAAY,EACZ,EAAU,EAC0B,EAAE;IACtC,MAAM,MAAM,GAAuC,EAAE,CAAA;IACrD,IAAI,KAAK,GAAG,IAAI,CAAA;IAEhB,OAAO,KAAK,GAAG,EAAE,EAAE,CAAC;QAClB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;YACxB,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,IAAI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