cspell-grammar 6.10.0 → 6.11.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.
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createParser = exports.parseDocument = void 0;
4
4
  const tokenizeLine_1 = require("./tokenizeLine");
5
- const cspell_pipe_1 = require("@cspell/cspell-pipe");
5
+ const sync_1 = require("@cspell/cspell-pipe/sync");
6
6
  function parseDocument(grammar, _filename, content, emitter = (line) => console.log(line)) {
7
7
  const r = (0, tokenizeLine_1.tokenizeText)(content, grammar);
8
- const tokens = (0, cspell_pipe_1.pipeSync)(r, (0, cspell_pipe_1.opMap)((tl) => tl.tokens.map((t) => ({ t, l: tl.line }))), (0, cspell_pipe_1.opFlatten)(), (0, cspell_pipe_1.opFilter)((t) => !t.t.scope.value.startsWith('punctuation')));
8
+ const tokens = (0, sync_1.pipe)(r, (0, sync_1.opMap)((tl) => tl.tokens.map((t) => ({ t, l: tl.line }))), (0, sync_1.opFlatten)(), (0, sync_1.opFilter)((t) => !t.t.scope.value.startsWith('punctuation')));
9
9
  for (const { t: token, l: line } of tokens) {
10
10
  emitter(`${(token.range[2] ?? line.lineNumber) + 1}:${token.range[0] + 1}\t ${JSON.stringify(token.text)}\t ${token.scope.toString()}`);
11
11
  }
@@ -19,11 +19,11 @@ function mapTokenizedLine(tl) {
19
19
  }));
20
20
  }
21
21
  function mapTokenizedLines(itl) {
22
- return (0, cspell_pipe_1.pipeSync)(itl, (0, cspell_pipe_1.opMap)(mapTokenizedLine), (0, cspell_pipe_1.opFlatten)());
22
+ return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)());
23
23
  }
24
24
  function createParser(grammar, name, transform = mapTokenizedLines) {
25
25
  function parse(content, filename) {
26
- const parsedTexts = (0, cspell_pipe_1.pipeSync)((0, tokenizeLine_1.tokenizeTextIterable)(content, grammar), transform);
26
+ const parsedTexts = (0, sync_1.pipe)((0, tokenizeLine_1.tokenizeTextIterable)(content, grammar), transform);
27
27
  return { content, filename, parsedTexts };
28
28
  }
29
29
  return { name, parse };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parser = void 0;
4
- const cspell_pipe_1 = require("@cspell/cspell-pipe");
4
+ const sync_1 = require("@cspell/cspell-pipe/sync");
5
5
  const __1 = require("../..");
6
6
  const typescript_1 = require("../../grammars/typescript");
7
7
  const appendMappedText_1 = require("../../mappers/appendMappedText");
@@ -82,7 +82,7 @@ function mapTokenizedLine(tl) {
82
82
  }));
83
83
  }
84
84
  function mapTokenizedLines(itl) {
85
- return (0, cspell_pipe_1.pipeSync)(itl, (0, cspell_pipe_1.opMap)(mapTokenizedLine), (0, cspell_pipe_1.opFlatten)(), transform, mergeStringResults);
85
+ return (0, sync_1.pipe)(itl, (0, sync_1.opMap)(mapTokenizedLine), (0, sync_1.opFlatten)(), transform, mergeStringResults);
86
86
  }
87
87
  exports.parser = (0, parser_1.createParser)(tsGrammar, 'typescript', mapTokenizedLines);
88
88
  function doesScopeMatch(s, match) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cspell-grammar",
3
- "version": "6.10.0",
3
+ "version": "6.11.0",
4
4
  "description": "Grammar parsing support for cspell",
5
5
  "keywords": [
6
6
  "cspell",
@@ -64,13 +64,13 @@
64
64
  "node": ">=14"
65
65
  },
66
66
  "devDependencies": {
67
- "@types/node": "^18.7.18",
68
- "jest": "^29.0.3",
67
+ "@types/node": "^18.7.23",
68
+ "jest": "^29.1.1",
69
69
  "rimraf": "^3.0.2"
70
70
  },
71
71
  "dependencies": {
72
- "@cspell/cspell-pipe": "^6.10.0",
73
- "@cspell/cspell-types": "^6.10.0"
72
+ "@cspell/cspell-pipe": "^6.11.0",
73
+ "@cspell/cspell-types": "^6.11.0"
74
74
  },
75
- "gitHead": "244f2ff310aa64bdb41cf93e85ba9e9f35c2b937"
75
+ "gitHead": "664676692898c3b6aa150fb2c6656b56f49a54b8"
76
76
  }