@sasjs/lint 4.5.0 → 4.6.0
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 +20 -0
- package/package.json +1 -1
- package/rules/file/index.d.ts +1 -0
- package/rules/file/index.js +3 -1
- package/rules/file/index.js.map +1 -1
- package/rules/file/minMacroNameLength.d.ts +13 -0
- package/rules/file/minMacroNameLength.js +132 -0
- package/rules/file/minMacroNameLength.js.map +1 -0
- package/rules/file/noUndeclaredMacros.js +13 -0
- package/rules/file/noUndeclaredMacros.js.map +1 -1
- package/rules/file/noUnusedMacros.js +3 -0
- package/rules/file/noUnusedMacros.js.map +1 -1
- package/sasjslint-schema.json +18 -0
- package/types/LintConfig.d.ts +1 -0
- package/types/LintConfig.js +20 -0
- package/types/LintConfig.js.map +1 -1
- package/utils/getLintConfig.d.ts +1 -0
- package/utils/getLintConfig.js +1 -0
- package/utils/getLintConfig.js.map +1 -1
- package/utils/parseMacroCalls.d.ts +4 -0
- package/utils/parseMacroCalls.js +39 -15
- package/utils/parseMacroCalls.js.map +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,7 @@ Configuration is via a `.sasjslint` file with the following structure (these are
|
|
|
37
37
|
"maxDataLineLength": 80,
|
|
38
38
|
"maxHeaderLineLength": 80,
|
|
39
39
|
"maxLineLength": 80,
|
|
40
|
+
"minMacroNameLength": 3,
|
|
40
41
|
"noBannedStrings": true,
|
|
41
42
|
"noEncodedPasswords": true,
|
|
42
43
|
"noGremlins": true,
|
|
@@ -315,6 +316,21 @@ See also:
|
|
|
315
316
|
- [maxDataLineLength](#maxdatalinelength)
|
|
316
317
|
- [maxHeaderLineLength](#maxheaderlinelength)
|
|
317
318
|
|
|
319
|
+
### minMacroNameLength
|
|
320
|
+
|
|
321
|
+
The shortest macro name the linter will treat as a macro name, and the shortest a file may define.
|
|
322
|
+
|
|
323
|
+
It exists because other languages write a percentage sign that reads as a macro call. The default of three is set by what those look like: a conversion is one character (`%s(`, `%d(`, `%x(`), a length modifier makes it two (`%ld(`, `%lu(`, `%Lf(`), and a macro name that anyone documents is longer than either - so three clears the specifiers a format string actually contains and still admits every real name. [`noUndeclaredMacros`](#noundeclaredmacros) applies the floor when it reads invocations, so a short "call" is not reported, and this rule reports a definition that short - so a macro the scanner could not see is caught where it is written rather than silently ignored. [`noUnusedMacros`](#nounusedmacros) deliberately does not apply it: over-counting a use keeps a declaration, while under-counting one has the formatter delete it, so every parsed name counts as a use.
|
|
324
|
+
|
|
325
|
+
The default covers `%s(` and the length-modifier forms such as `%ld(`. A longer conversion - `%lld(` - still reads as a name, and a file that formats numbers that way raises the floor for itself (`@sasjslint {"minMacroNameLength": 4}`), lists those names in [`ignoredMacros`](#ignoredmacros), or switches the rule off for itself. The linter does not try to parse a format string: the residue is a handful of names in a handful of files, and a specifier table would have to track every dialect that writes one.
|
|
326
|
+
|
|
327
|
+
A definition that lives inside a multi-line double-quoted string - a template the file writes out rather than code it runs - is read as a definition, because the macro parser reads lines rather than tracking quotes. A single-quoted template cannot span lines in SAS and is not read that way. That file raises the floor for itself or switches the rule off.
|
|
328
|
+
|
|
329
|
+
Short macro names are legal SAS, but they are not documentable: `%macro s();` reads as a format specifier in every context a reader meets it. To turn the floor off, set the value to 1, which also returns `noUndeclaredMacros` to reading single-character names.
|
|
330
|
+
|
|
331
|
+
- Default: 3
|
|
332
|
+
- Severity: WARNING
|
|
333
|
+
|
|
318
334
|
### noBannedStrings
|
|
319
335
|
|
|
320
336
|
Reports every line that contains one of the strings in [`bannedStrings`](#bannedstrings), anywhere in the line - in a comment, in a string literal, or in code, because the text is read the way a person or a log scanner reads it rather than as SAS tokens.
|
|
@@ -431,6 +447,8 @@ The macros that ship with SAS (`%scan`, `%index`, `%sysfunc` and the other macro
|
|
|
431
447
|
|
|
432
448
|
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.
|
|
433
449
|
|
|
450
|
+
A name written inside a single-quoted string is reported too, for the same reason as the masking case in reverse: the string is usually a program the file submits, so the macro has to be available when it runs. Text in a string is not always code, though, so two tests keep the noise down. A name shorter than [`minMacroNameLength`](#minmacronamelength) is never reported (`%s(`, `%d(`, `%x(`), and a name inside a string counts only when an opening parenthesis follows it - a generated program calls a macro that way, while a SQL LIKE pattern (`'%abc%'`) or a conversion specifier has nothing after the name. The parenthesis test sits with [`hasMacroParentheses`](#hasmacroparentheses), which requires every definition in the codebase to declare one. A template carrying the macros that its generated program declares for itself goes in [`ignoredMacros`](#ignoredmacros) or has the rule switched off for that file with a `@sasjslint` block.
|
|
451
|
+
|
|
434
452
|
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.
|
|
435
453
|
|
|
436
454
|
- Default: true
|
|
@@ -488,6 +506,8 @@ A macro can be referenced indirectly - for example by another macro in the depen
|
|
|
488
506
|
|
|
489
507
|
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.
|
|
490
508
|
|
|
509
|
+
An invocation written inside a single-quoted string counts as a use as well. SAS resolves no macro trigger there, so the text is data while the string is built - but code that generates code submits it later: `call execute('%mf_mkdir('!!path!!')')` runs the macro when the DATA step executes, and a program written to a fileref and `%inc`ed runs it then. Counting it as unused would report a declaration the file needs, and the formatter would delete it.
|
|
510
|
+
|
|
491
511
|
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.
|
|
492
512
|
|
|
493
513
|
- Default: true
|
package/package.json
CHANGED
package/rules/file/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { hasDoxygenHeader } from './hasDoxygenHeader';
|
|
|
2
2
|
export { hasMacroNameInMend } from './hasMacroNameInMend';
|
|
3
3
|
export { hasMacroParentheses } from './hasMacroParentheses';
|
|
4
4
|
export { lineEndings } from './lineEndings';
|
|
5
|
+
export { minMacroNameLength } from './minMacroNameLength';
|
|
5
6
|
export { noNestedCommentsInHeader } from './noNestedCommentsInHeader';
|
|
6
7
|
export { noNestedMacros } from './noNestedMacros';
|
|
7
8
|
export { noUndeclaredMacros } from './noUndeclaredMacros';
|
package/rules/file/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.noSingleAsteriskComments = exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noUnusedLibnames = exports.noUnusedMacros = exports.noUndeclaredMacros = exports.noNestedMacros = exports.noNestedCommentsInHeader = exports.lineEndings = exports.hasMacroParentheses = exports.hasMacroNameInMend = exports.hasDoxygenHeader = void 0;
|
|
3
|
+
exports.noSingleAsteriskComments = exports.hasRequiredMacroOptions = exports.strictMacroDefinition = exports.noUnusedLibnames = exports.noUnusedMacros = exports.noUndeclaredMacros = exports.noNestedMacros = exports.noNestedCommentsInHeader = exports.minMacroNameLength = exports.lineEndings = exports.hasMacroParentheses = exports.hasMacroNameInMend = exports.hasDoxygenHeader = void 0;
|
|
4
4
|
var hasDoxygenHeader_1 = require("./hasDoxygenHeader");
|
|
5
5
|
Object.defineProperty(exports, "hasDoxygenHeader", { enumerable: true, get: function () { return hasDoxygenHeader_1.hasDoxygenHeader; } });
|
|
6
6
|
var hasMacroNameInMend_1 = require("./hasMacroNameInMend");
|
|
@@ -9,6 +9,8 @@ var hasMacroParentheses_1 = require("./hasMacroParentheses");
|
|
|
9
9
|
Object.defineProperty(exports, "hasMacroParentheses", { enumerable: true, get: function () { return hasMacroParentheses_1.hasMacroParentheses; } });
|
|
10
10
|
var lineEndings_1 = require("./lineEndings");
|
|
11
11
|
Object.defineProperty(exports, "lineEndings", { enumerable: true, get: function () { return lineEndings_1.lineEndings; } });
|
|
12
|
+
var minMacroNameLength_1 = require("./minMacroNameLength");
|
|
13
|
+
Object.defineProperty(exports, "minMacroNameLength", { enumerable: true, get: function () { return minMacroNameLength_1.minMacroNameLength; } });
|
|
12
14
|
var noNestedCommentsInHeader_1 = require("./noNestedCommentsInHeader");
|
|
13
15
|
Object.defineProperty(exports, "noNestedCommentsInHeader", { enumerable: true, get: function () { return noNestedCommentsInHeader_1.noNestedCommentsInHeader; } });
|
|
14
16
|
var noNestedMacros_1 = require("./noNestedMacros");
|
package/rules/file/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/file/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/file/index.ts"],"names":[],"mappings":";;;AAAA,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,6DAA2D;AAAlD,0HAAA,mBAAmB,OAAA;AAC5B,6CAA2C;AAAlC,0GAAA,WAAW,OAAA;AACpB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA;AACjC,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,mDAAiD;AAAxC,gHAAA,cAAc,OAAA;AACvB,uDAAqD;AAA5C,oHAAA,gBAAgB,OAAA;AACzB,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FileLintRule } from '../../types/LintRule';
|
|
2
|
+
/**
|
|
3
|
+
* Reports a macro definition whose name is shorter than the configured floor.
|
|
4
|
+
*
|
|
5
|
+
* The floor exists because other languages write a percentage specifier that
|
|
6
|
+
* reads as a macro call, and the default of three is the width of the ones a
|
|
7
|
+
* format string actually contains: a conversion is one character (`%s(`,
|
|
8
|
+
* `%d(`), a length modifier makes it two (`%ld(`, `%lu(`, `%Lf(`), and a name
|
|
9
|
+
* anyone documents is longer than either. `noUndeclaredMacros` reads
|
|
10
|
+
* invocations through the same floor, so a definition the scanner could not
|
|
11
|
+
* see is reported here instead of being silently ignored.
|
|
12
|
+
*/
|
|
13
|
+
export declare const minMacroNameLength: FileLintRule;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.minMacroNameLength = void 0;
|
|
4
|
+
const types_1 = require("../../types");
|
|
5
|
+
const LintRuleType_1 = require("../../types/LintRuleType");
|
|
6
|
+
const Severity_1 = require("../../types/Severity");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const getColumnNumber_1 = require("../../utils/getColumnNumber");
|
|
9
|
+
const parseMacros_1 = require("../../utils/parseMacros");
|
|
10
|
+
const splitLines_1 = require("../../utils/splitLines");
|
|
11
|
+
const name = 'minMacroNameLength';
|
|
12
|
+
const description = 'Ensure a macro name is long enough not to collide with another language.';
|
|
13
|
+
const message = `Macro name '{macro}' is shorter than {length} characters`;
|
|
14
|
+
/** Escapes a macro name so it can be interpolated into a RegExp literally. */
|
|
15
|
+
const escapeRegExp = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
16
|
+
/**
|
|
17
|
+
* The block-comment spans on a line. A `/*` inside a single-quoted string opens
|
|
18
|
+
* nothing - `%put '/*';` writes those characters - so the scan tracks quotes.
|
|
19
|
+
*/
|
|
20
|
+
const commentSpans = (line) => {
|
|
21
|
+
const spans = [];
|
|
22
|
+
let inString = false;
|
|
23
|
+
let start = -1;
|
|
24
|
+
for (let index = 0; index < line.length; index++) {
|
|
25
|
+
const char = line[index];
|
|
26
|
+
if (char === "'") {
|
|
27
|
+
inString = !inString;
|
|
28
|
+
}
|
|
29
|
+
else if (!inString && char === '/' && line[index + 1] === '*') {
|
|
30
|
+
start = index;
|
|
31
|
+
index++;
|
|
32
|
+
}
|
|
33
|
+
else if (!inString &&
|
|
34
|
+
char === '*' &&
|
|
35
|
+
line[index + 1] === '/' &&
|
|
36
|
+
start > -1) {
|
|
37
|
+
spans.push([start, index + 2]);
|
|
38
|
+
start = -1;
|
|
39
|
+
index++;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (start > -1)
|
|
43
|
+
spans.push([start, line.length]);
|
|
44
|
+
return spans;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* True when the offset sits inside a block comment on this line. A comment can
|
|
48
|
+
* carry a declaration that is not the one being reported - `/* %macro a(); *\/`
|
|
49
|
+
* before the real `%macro s();` - and that text takes no position.
|
|
50
|
+
*/
|
|
51
|
+
const inComment = (line, index) => {
|
|
52
|
+
const spans = commentSpans(line);
|
|
53
|
+
return spans.some(([start, end]) => index > start && index < end);
|
|
54
|
+
};
|
|
55
|
+
const test = (value, config) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const severity = (config === null || config === void 0 ? void 0 : config.severityLevel[name]) || Severity_1.Severity.Warning;
|
|
58
|
+
const minimum = (_a = config === null || config === void 0 ? void 0 : config.minMacroNameLength) !== null && _a !== void 0 ? _a : 3;
|
|
59
|
+
// A floor below two characters switches the rule off, the way a zero
|
|
60
|
+
// `maxLineLength` switches its rule off.
|
|
61
|
+
if (minimum < 2)
|
|
62
|
+
return [];
|
|
63
|
+
const lines = (0, splitLines_1.splitLines)(value);
|
|
64
|
+
const cfg = config || new types_1.LintConfig();
|
|
65
|
+
// A data section - `cards` / `parmcards` / `datalines` - holds text that is
|
|
66
|
+
// written somewhere, so a `%macro x();` in it is payload rather than a
|
|
67
|
+
// definition. The macro parser reads the block as code, so the extent comes
|
|
68
|
+
// from the same helper the line rules use, which keeps one definition of a
|
|
69
|
+
// data section in the package.
|
|
70
|
+
const dataSections = (0, utils_1.getDataSectionsDetail)(value, cfg);
|
|
71
|
+
// A name can appear more than once on a line, so each declaration takes the
|
|
72
|
+
// match at its own position rather than the first one.
|
|
73
|
+
const seen = new Map();
|
|
74
|
+
return ((0, parseMacros_1.parseMacros)(value, cfg)
|
|
75
|
+
// An orphan `%mend` yields an entry with no name and no start line, which
|
|
76
|
+
// has no definition to measure and no line to report on.
|
|
77
|
+
.filter((macro) => { var _a; return macro.name && ((_a = macro.startLineNumbers) === null || _a === void 0 ? void 0 : _a.length); })
|
|
78
|
+
.filter((macro) => macro.name.length < minimum)
|
|
79
|
+
.filter((macro) => !(0, utils_1.checkIsDataLine)(dataSections, macro.startLineNumbers[0] - 1))
|
|
80
|
+
.map((macro) => {
|
|
81
|
+
var _a;
|
|
82
|
+
const lineNumber = macro.startLineNumbers[0];
|
|
83
|
+
const line = lines[lineNumber - 1] || '';
|
|
84
|
+
// The diagnostic covers `%macro <name>`. The column comes from the
|
|
85
|
+
// declaration itself rather than the first `%macro` on the line, so a
|
|
86
|
+
// comment that mentions one - `/* %macro a(); */ %macro s();` - does not
|
|
87
|
+
// take the position. The name has to match, which is what tells this
|
|
88
|
+
// declaration apart from an earlier one on the same line.
|
|
89
|
+
const key = `${lineNumber}:${macro.name.toLowerCase()}`;
|
|
90
|
+
const occurrence = (_a = seen.get(key)) !== null && _a !== void 0 ? _a : 0;
|
|
91
|
+
seen.set(key, occurrence + 1);
|
|
92
|
+
const matches = [
|
|
93
|
+
...line.matchAll(new RegExp(`%macro\\s+${escapeRegExp(macro.name)}\\b`, 'gi'))
|
|
94
|
+
].filter((match) => !inComment(line, match.index));
|
|
95
|
+
const declaration = matches[occurrence];
|
|
96
|
+
const startColumnNumber = declaration
|
|
97
|
+
? declaration.index + 1
|
|
98
|
+
: (0, getColumnNumber_1.getColumnNumber)(line, '%macro');
|
|
99
|
+
return {
|
|
100
|
+
message: message
|
|
101
|
+
.replace('{macro}', macro.name)
|
|
102
|
+
.replace('{length}', String(minimum)),
|
|
103
|
+
lineNumber,
|
|
104
|
+
startColumnNumber,
|
|
105
|
+
// When the name is on a later line than `%macro`, the diagnostic
|
|
106
|
+
// covers the keyword itself rather than the rest of the line.
|
|
107
|
+
endColumnNumber: declaration
|
|
108
|
+
? startColumnNumber + declaration[0].length - 1
|
|
109
|
+
: startColumnNumber + '%macro'.length - 1,
|
|
110
|
+
severity
|
|
111
|
+
};
|
|
112
|
+
}));
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Reports a macro definition whose name is shorter than the configured floor.
|
|
116
|
+
*
|
|
117
|
+
* The floor exists because other languages write a percentage specifier that
|
|
118
|
+
* reads as a macro call, and the default of three is the width of the ones a
|
|
119
|
+
* format string actually contains: a conversion is one character (`%s(`,
|
|
120
|
+
* `%d(`), a length modifier makes it two (`%ld(`, `%lu(`, `%Lf(`), and a name
|
|
121
|
+
* anyone documents is longer than either. `noUndeclaredMacros` reads
|
|
122
|
+
* invocations through the same floor, so a definition the scanner could not
|
|
123
|
+
* see is reported here instead of being silently ignored.
|
|
124
|
+
*/
|
|
125
|
+
exports.minMacroNameLength = {
|
|
126
|
+
type: LintRuleType_1.LintRuleType.File,
|
|
127
|
+
name,
|
|
128
|
+
description,
|
|
129
|
+
message,
|
|
130
|
+
test
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=minMacroNameLength.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minMacroNameLength.js","sourceRoot":"","sources":["../../../src/rules/file/minMacroNameLength.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AAEpD,2DAAuD;AACvD,mDAA+C;AAC/C,uCAAoE;AACpE,iEAA6D;AAC7D,yDAAqD;AACrD,uDAAmD;AAEnD,MAAM,IAAI,GAAG,oBAAoB,CAAA;AACjC,MAAM,WAAW,GACf,0EAA0E,CAAA;AAC5E,MAAM,OAAO,GAAG,0DAA0D,CAAA;AAE1E,8EAA8E;AAC9E,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE,CACrC,KAAK,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;AAE9C;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,MAAM,KAAK,GAAuB,EAAE,CAAA;IACpC,IAAI,QAAQ,GAAG,KAAK,CAAA;IACpB,IAAI,KAAK,GAAG,CAAC,CAAC,CAAA;IAEd,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAA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QAAA,kBAAkB,GAAiB;IAC9C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;CACL,CAAA"}
|
|
@@ -41,10 +41,23 @@ const getUndeclaredCalls = (value, config) => {
|
|
|
41
41
|
const undeclared = [];
|
|
42
42
|
const seen = new Set();
|
|
43
43
|
(0, parseMacroCalls_1.parseMacroCalls)(value, config).forEach((call) => {
|
|
44
|
+
var _a;
|
|
44
45
|
const key = call.name.toLowerCase();
|
|
45
46
|
if (seen.has(key))
|
|
46
47
|
return;
|
|
47
48
|
seen.add(key);
|
|
49
|
+
// A name shorter than the floor is not a macro name: Lua and printf put
|
|
50
|
+
// `%s(` and friends inside strings. The `minMacroNameLength` rule reports
|
|
51
|
+
// a definition that short, so the two agree about what a name is.
|
|
52
|
+
if (call.name.length < ((_a = config.minMacroNameLength) !== null && _a !== void 0 ? _a : 3))
|
|
53
|
+
return;
|
|
54
|
+
// In a string a name is a call when an opening parenthesis follows it: a
|
|
55
|
+
// generated program calls a macro that way, while a SQL LIKE pattern or a
|
|
56
|
+
// conversion specifier has nothing after the name. The test lives here and
|
|
57
|
+
// not in the parser because noUnusedMacros counts every name - a use it
|
|
58
|
+
// misses is a declaration the formatter deletes.
|
|
59
|
+
if (call.quoted && !call.hasParen)
|
|
60
|
+
return;
|
|
48
61
|
if ((0, sasMacros_1.isSasMacro)(call.name))
|
|
49
62
|
return;
|
|
50
63
|
if (ignored.has(key))
|
|
@@ -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,MA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AAM,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"}
|
|
@@ -23,6 +23,9 @@ const message = `Macro '{macro}' is declared in the <h4> SAS Macros </h4> sectio
|
|
|
23
23
|
const getUnusedMacros = (value, config) => {
|
|
24
24
|
if (!value)
|
|
25
25
|
return [];
|
|
26
|
+
// Every parsed name counts as a use, including one shorter than
|
|
27
|
+
// `minMacroNameLength`: over-counting a use keeps a declaration, and
|
|
28
|
+
// under-counting one has the formatter delete it.
|
|
26
29
|
const used = new Set((0, parseMacroCalls_1.parseMacroCalls)(value, config, { includeMasked: true }).map((call) => call.name.toLowerCase()));
|
|
27
30
|
const unused = [];
|
|
28
31
|
const reported = new Set();
|
|
@@ -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,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,e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E,KAAK,CAAC,IAAI,CAAC;QAC/C,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,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,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IAErE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM;QAC3B,CAAC,CAAC,IAAA,qCAAsB,EAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC;QAC5C,CAAC,CAAC,KAAK,CAAA;IAET,4EAA4E;IAC5E,2EAA2E;IAC3E,2CAA2C;IAC3C,OAAO,IAAA,+BAAgB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACvC,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,cAAc,GAAiB;IAC1C,IAAI,EAAE,2BAAY,CAAC,IAAI;IACvB,IAAI;IACJ,WAAW;IACX,OAAO;IACP,IAAI;IACJ,GAAG;CACJ,CAAA"}
|
package/sasjslint-schema.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"maxDataLineLength": 80,
|
|
22
22
|
"maxHeaderLineLength": 80,
|
|
23
23
|
"maxLineLength": 80,
|
|
24
|
+
"minMacroNameLength": 3,
|
|
24
25
|
"noBannedStrings": true,
|
|
25
26
|
"noEncodedPasswords": true,
|
|
26
27
|
"noGremlins": true,
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"noSpacesInFileNames": true,
|
|
46
47
|
"lowerCaseFileNames": true,
|
|
47
48
|
"maxLineLength": 80,
|
|
49
|
+
"minMacroNameLength": 3,
|
|
48
50
|
"maxHeaderLineLength": 80,
|
|
49
51
|
"maxDataLineLength": 80,
|
|
50
52
|
"noGremlins": true,
|
|
@@ -190,6 +192,15 @@
|
|
|
190
192
|
"default": 80,
|
|
191
193
|
"examples": [60, 80, 120]
|
|
192
194
|
},
|
|
195
|
+
"minMacroNameLength": {
|
|
196
|
+
"$id": "#/properties/minMacroNameLength",
|
|
197
|
+
"type": "integer",
|
|
198
|
+
"minimum": 1,
|
|
199
|
+
"title": "minMacroNameLength",
|
|
200
|
+
"description": "Sets the shortest macro name the linter treats as a macro name, and the shortest a file may define. A short name cannot be told apart from a format specifier inside a string - %s( is one character, %ld( is two. Shows a warning for a definition shorter than this. Set to 1 to switch the rule off.",
|
|
201
|
+
"default": 3,
|
|
202
|
+
"examples": [3, 4]
|
|
203
|
+
},
|
|
193
204
|
"noNestedCommentsInHeader": {
|
|
194
205
|
"$id": "#/properties/noNestedCommentsInHeader",
|
|
195
206
|
"type": "boolean",
|
|
@@ -404,6 +415,13 @@
|
|
|
404
415
|
"enum": ["error", "warn"],
|
|
405
416
|
"default": "warn"
|
|
406
417
|
},
|
|
418
|
+
"minMacroNameLength": {
|
|
419
|
+
"$id": "#/properties/severityLevel/minMacroNameLength",
|
|
420
|
+
"title": "minMacroNameLength",
|
|
421
|
+
"type": "string",
|
|
422
|
+
"enum": ["error", "warn"],
|
|
423
|
+
"default": "warn"
|
|
424
|
+
},
|
|
407
425
|
"noNestedCommentsInHeader": {
|
|
408
426
|
"$id": "#/properties/severityLevel/noNestedCommentsInHeader",
|
|
409
427
|
"title": "noNestedCommentsInHeader",
|
package/types/LintConfig.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export declare class LintConfig {
|
|
|
20
20
|
readonly maxHeaderLineLength: number;
|
|
21
21
|
readonly maxDataLineLength: number;
|
|
22
22
|
readonly indentationMultiple: number;
|
|
23
|
+
readonly minMacroNameLength: number;
|
|
23
24
|
readonly lineEndings: LineEndings;
|
|
24
25
|
readonly defaultHeader: string;
|
|
25
26
|
readonly severityLevel: {
|
package/types/LintConfig.js
CHANGED
|
@@ -26,6 +26,7 @@ class LintConfig {
|
|
|
26
26
|
this.maxHeaderLineLength = 80;
|
|
27
27
|
this.maxDataLineLength = 80;
|
|
28
28
|
this.indentationMultiple = 2;
|
|
29
|
+
this.minMacroNameLength = 3;
|
|
29
30
|
this.lineEndings = LineEndings_1.LineEndings.LF;
|
|
30
31
|
this.defaultHeader = (0, utils_1.getDefaultHeader)();
|
|
31
32
|
this.severityLevel = {};
|
|
@@ -144,6 +145,25 @@ class LintConfig {
|
|
|
144
145
|
if ((json === null || json === void 0 ? void 0 : json.noNestedMacros) !== false) {
|
|
145
146
|
this.fileLintRules.push(file_1.noNestedMacros);
|
|
146
147
|
}
|
|
148
|
+
// Absence means the documented default, so a project that omits the key
|
|
149
|
+
// still gets the floor. A value below two switches the rule off, the way a
|
|
150
|
+
// zero `maxLineLength` does - and the value is still kept, so the macro
|
|
151
|
+
// rules read one-character names again.
|
|
152
|
+
if ((json === null || json === void 0 ? void 0 : json.minMacroNameLength) !== undefined) {
|
|
153
|
+
// A name length is a whole number of at least one. `isNaN` alone coerces,
|
|
154
|
+
// so it would accept "3" and true, and a fraction or a value below one
|
|
155
|
+
// would store a floor no name can be measured against - 1 is the
|
|
156
|
+
// documented way to switch the rule off.
|
|
157
|
+
if (typeof (json === null || json === void 0 ? void 0 : json.minMacroNameLength) !== 'number' ||
|
|
158
|
+
!Number.isInteger(json.minMacroNameLength) ||
|
|
159
|
+
json.minMacroNameLength < 1) {
|
|
160
|
+
throw new Error(`Property "minMacroNameLength" must be an integer of 1 or more.`);
|
|
161
|
+
}
|
|
162
|
+
this.minMacroNameLength = json.minMacroNameLength;
|
|
163
|
+
}
|
|
164
|
+
if ((json === null || json === void 0 ? void 0 : json.minMacroNameLength) === undefined || json.minMacroNameLength > 1) {
|
|
165
|
+
this.fileLintRules.push(file_1.minMacroNameLength);
|
|
166
|
+
}
|
|
147
167
|
if ((json === null || json === void 0 ? void 0 : json.hasMacroParentheses) !== false) {
|
|
148
168
|
this.fileLintRules.push(file_1.hasMacroParentheses);
|
|
149
169
|
}
|
package/types/LintConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"LintConfig.js","sourceRoot":"","sources":["../../src/types/LintConfig.ts"],"names":[],"mappings":";;;AAAA,wCAcsB;AACtB,wCAQsB;AACtB,wCAAuE;AACvE,+CAA2C;AAE3C,oCAIiB;AACjB,8DAA0D;AAC1D,yCAAqC;AAErC;;;;;;GAMG;AACH,MAAa,UAAU;IAqBrB,YAAY,IAAU;QAlBb,eAAU,GAAa,EAAE,CAAA;QACzB,oBAAe,GAAa,EAAE,CAAA;QAC9B,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAmB,EAAE,CAAA;QAClC,kBAAa,GAAW,EAAE,CAAA;QAC1B,wBAAmB,GAAW,EAAE,CAAA;QAChC,sBAAiB,GAAW,EAAE,CAAA;QAC9B,wBAAmB,GAAW,CAAC,CAAA;QAC/B,uBAAkB,GAAW,CAAC,CAAA;QAC9B,gBAAW,GAAgB,yBAAW,CAAC,EAAE,CAAA;QACzC,kBAAa,GAAW,IAAA,wBAAgB,GAAE,CAAA;QAC1C,kBAAa,GAAgC,EAAE,CAAA;QAC/C,yBAAoB,GAAa,EAAE,CAAA;QACnC,oBAAe,GAAa,EAAE,CAAA;QAC9B,kBAAa,GAAa,EAAE,CAAA;QAC5B,kBAAa,GAAa,EAAE,CAAA;QAGnC,IAAI,CAAC,MAAM,GAAG,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAA;QAExB,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,EAAE,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AC;qBAAM,CAAC;oBACN,MAAM,IAAI,KAAK,CACb,wGAAwG,CACzG,CAAA;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,aAAa,EAAE,CAAC;YACxB,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBAClE,IAAI,QAAQ,KAAK,MAAM;oBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,OAAO,CAAA;gBACpE,IAAI,QAAQ,KAAK,OAAO;oBAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,mBAAQ,CAAC,KAAK,CAAA;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAS;QAChB,MAAM,MAAM,qBAAQ,IAAI,CAAC,MAAM,CAAE,CAAA;QAEjC,wEAAwE;QACxE,0EAA0E;QAC1E,4EAA4E;QAC5E,iEAAiE;QACjE,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAA;QAChD,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,CAAC,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,CAAA;QAChD,CAAC;QAED,OAAO,IAAI,UAAU,CAAC,IAAA,iCAAe,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAA;IACtD,CAAC;CACF;AAlTD,gCAkTC"}
|
package/utils/getLintConfig.d.ts
CHANGED
package/utils/getLintConfig.js
CHANGED
|
@@ -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":";;;;;;;;;;;;;;;AA4DA,sCASC;AArED,gDAAuB;AACvB,4CAAmB;AACnB,oDAAgD;AAChD,4CAA4C;AAC5C,qDAAiD;AACjD,sDAAkD;AAClD,iEAA6D;AAC7D,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,CAAC,GAAG,2CAAoB,CAAC;IACxC,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,CAAC;IACrB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;IACxB,UAAU,EAAE,IAAI;IAChB,wBAAwB,EAAE,IAAI;IAC9B,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"}
|
|
@@ -7,6 +7,10 @@ export interface MacroCall {
|
|
|
7
7
|
lineNumber: number;
|
|
8
8
|
startColumnNumber: number;
|
|
9
9
|
endColumnNumber: number;
|
|
10
|
+
/** True when the token sits inside a single-quoted string. */
|
|
11
|
+
quoted?: boolean;
|
|
12
|
+
/** True when an opening parenthesis follows the name. */
|
|
13
|
+
hasParen?: boolean;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* Options for the scan.
|
package/utils/parseMacroCalls.js
CHANGED
|
@@ -13,18 +13,19 @@ const embeddedLanguageProc = /^proc\s+(lua|groovy)\b/i;
|
|
|
13
13
|
const embeddedLanguageEnd = /^endsubmit\s*;/i;
|
|
14
14
|
const embeddedLanguageEndSearch = /endsubmit/i;
|
|
15
15
|
/**
|
|
16
|
-
* Finds the `%name` tokens inside
|
|
16
|
+
* Finds the `%name` tokens inside a region that is text rather than code - the
|
|
17
|
+
* argument of a masking function, or the body of a single-quoted string.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* Since the region is text, a quote or a comment marker in it opens nothing.
|
|
20
|
+
* The scan therefore recognises only the escapes `%(` / `%)` and a `%name`
|
|
21
|
+
* token, and it does not report a `%name:` label.
|
|
21
22
|
*
|
|
22
23
|
* @param {string} text - the whole file.
|
|
23
|
-
* @param {number} from - the offset at which the
|
|
24
|
+
* @param {number} from - the offset at which the region starts.
|
|
24
25
|
* @param {number} to - the offset at which it ends.
|
|
25
26
|
* @returns {{ name: string; offset: number }[]} the tokens, in order.
|
|
26
27
|
*/
|
|
27
|
-
const
|
|
28
|
+
const findNameTokens = (text, from, to) => {
|
|
28
29
|
const tokens = [];
|
|
29
30
|
let index = from;
|
|
30
31
|
while (index < to) {
|
|
@@ -35,8 +36,17 @@ const findMaskedCalls = (text, from, to) => {
|
|
|
35
36
|
}
|
|
36
37
|
const macroName = macroNameStart.exec(text.slice(index, to));
|
|
37
38
|
if (macroName) {
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
const after = text.slice(index + macroName[0].length, to);
|
|
40
|
+
const isLabel = after.startsWith(':');
|
|
41
|
+
if (!isLabel) {
|
|
42
|
+
// Reported, not filtered: whether a bare name in a string is a call
|
|
43
|
+
// is the reporting rule's decision, and a use that goes unseen costs
|
|
44
|
+
// a declaration.
|
|
45
|
+
tokens.push({
|
|
46
|
+
name: macroName[1],
|
|
47
|
+
offset: index,
|
|
48
|
+
hasParen: /^\s*\(/.test(after)
|
|
49
|
+
});
|
|
40
50
|
}
|
|
41
51
|
index += macroName[0].length;
|
|
42
52
|
continue;
|
|
@@ -108,8 +118,15 @@ const parseMacroCalls = (text, config, options) => {
|
|
|
108
118
|
index++;
|
|
109
119
|
continue;
|
|
110
120
|
}
|
|
111
|
-
// Single-quoted string -
|
|
112
|
-
//
|
|
121
|
+
// Single-quoted string - SAS resolves no macro trigger in it, so it is
|
|
122
|
+
// data. The scan matches straight to the next quote: SAS also treats a
|
|
123
|
+
// doubled quote as an escaped character, but a pair either closes and
|
|
124
|
+
// reopens the string or is skipped, and both leave every character after
|
|
125
|
+
// it in the same state, so modelling the escape changes nothing that can
|
|
126
|
+
// be observed here. An apostrophe inside a double-quoted string is
|
|
127
|
+
// ordinary text. A caller that asks which macros the file uses still wants
|
|
128
|
+
// the invocations in it, because code that generates code submits this
|
|
129
|
+
// text later, so its invocations are reported.
|
|
113
130
|
if (char === "'") {
|
|
114
131
|
if (inDoubleQuote) {
|
|
115
132
|
columnNumber++;
|
|
@@ -119,10 +136,6 @@ const parseMacroCalls = (text, config, options) => {
|
|
|
119
136
|
let end = index + 1;
|
|
120
137
|
while (end < length) {
|
|
121
138
|
if (text[end] === "'") {
|
|
122
|
-
if (text[end + 1] === "'") {
|
|
123
|
-
end += 2;
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
139
|
end++;
|
|
127
140
|
break;
|
|
128
141
|
}
|
|
@@ -130,6 +143,17 @@ const parseMacroCalls = (text, config, options) => {
|
|
|
130
143
|
break;
|
|
131
144
|
end++;
|
|
132
145
|
}
|
|
146
|
+
findNameTokens(text, index + 1, end).forEach((token) => {
|
|
147
|
+
advanceTo(token.offset);
|
|
148
|
+
calls.push({
|
|
149
|
+
name: token.name,
|
|
150
|
+
lineNumber,
|
|
151
|
+
startColumnNumber: columnNumber,
|
|
152
|
+
endColumnNumber: columnNumber + 1 + token.name.length,
|
|
153
|
+
quoted: true,
|
|
154
|
+
hasParen: token.hasParen
|
|
155
|
+
});
|
|
156
|
+
});
|
|
133
157
|
advanceTo(end);
|
|
134
158
|
continue;
|
|
135
159
|
}
|
|
@@ -203,7 +227,7 @@ const parseMacroCalls = (text, config, options) => {
|
|
|
203
227
|
// formatter delete a declaration the file needs.
|
|
204
228
|
const argumentStart = index + maskingFunction[0].length;
|
|
205
229
|
advanceTo(argumentStart);
|
|
206
|
-
|
|
230
|
+
findNameTokens(text, argumentStart, end).forEach((token) => {
|
|
207
231
|
advanceTo(token.offset);
|
|
208
232
|
calls.push({
|
|
209
233
|
name: token.name,
|
|
@@ -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":";;;AAkCA,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;;;;;;;;;;;;GAYG;AACH,MAAM,cAAc,GAAG,CACrB,IAAY,EACZ,IAAY,EACZ,EAAU,EAC6C,EAAE;IACzD,MAAM,MAAM,GAA0D,EAAE,CAAA;IACxE,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,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;gBACvD,KAAK,IAAI,CAAC,CAAA;gBACV,SAAQ;YACV,CAAC;YAED,MAAM,SAAS,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAAA;YAC5D,IAAI,SAAS,EAAE,CAAC;gBACd,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;gBACzD,MAAM,OAAO,GAAG,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