clarity-pattern-parser 8.4.2 → 8.4.3
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/package.json +1 -1
- package/src/grammar/Grammar.ts +0 -13
package/package.json
CHANGED
package/src/grammar/Grammar.ts
CHANGED
|
@@ -67,7 +67,6 @@ export class Grammar {
|
|
|
67
67
|
|
|
68
68
|
await this._resolveImports(ast);
|
|
69
69
|
this._buildPatterns(ast);
|
|
70
|
-
this._cleanAst(ast);
|
|
71
70
|
|
|
72
71
|
return this._parseContext.patternsByName;
|
|
73
72
|
}
|
|
@@ -81,8 +80,6 @@ export class Grammar {
|
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
this._buildPatterns(ast);
|
|
84
|
-
this._cleanAst(ast);
|
|
85
|
-
|
|
86
83
|
return this._parseContext.patternsByName;
|
|
87
84
|
}
|
|
88
85
|
|
|
@@ -114,16 +111,6 @@ export class Grammar {
|
|
|
114
111
|
return importBlock && importBlock.children.length > 0;
|
|
115
112
|
}
|
|
116
113
|
|
|
117
|
-
private _cleanAst(ast: Node) {
|
|
118
|
-
ast.findAll(
|
|
119
|
-
n => n.name === "spaces" ||
|
|
120
|
-
n.name === "optional-spaces" ||
|
|
121
|
-
n.name === "new-line" ||
|
|
122
|
-
n.name.includes("whitespace") ||
|
|
123
|
-
n.name.includes("comment")
|
|
124
|
-
).forEach(n => n.remove());
|
|
125
|
-
}
|
|
126
|
-
|
|
127
114
|
private _buildPatterns(ast: Node) {
|
|
128
115
|
ast.children.forEach((n) => {
|
|
129
116
|
const typeNode = n.find(n => n.name.includes("literal"));
|