@driftsys/markspec 0.12.1 → 0.13.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/esm/ast/build.d.ts.map +1 -1
- package/esm/ast/build.js +19 -5
- package/esm/ast/equivalence.js +14 -2
- package/esm/ast/nodes.d.ts +15 -3
- package/esm/ast/nodes.d.ts.map +1 -1
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +18 -3
- package/esm/compiler/mod.d.ts +34 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +112 -48
- package/esm/compiler/schema.d.ts +3 -2
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +6 -3
- package/esm/criteria/scenarios.d.ts +55 -0
- package/esm/criteria/scenarios.d.ts.map +1 -0
- package/esm/criteria/scenarios.js +133 -0
- package/esm/discovery/mod.d.ts +20 -1
- package/esm/discovery/mod.d.ts.map +1 -1
- package/esm/discovery/mod.js +105 -17
- package/esm/formatter/entry_body.d.ts +8 -5
- package/esm/formatter/entry_body.d.ts.map +1 -1
- package/esm/formatter/entry_body.js +12 -8
- package/esm/formatter/feature_file.d.ts +40 -0
- package/esm/formatter/feature_file.d.ts.map +1 -0
- package/esm/formatter/feature_file.js +88 -0
- package/esm/formatter/mod.d.ts +21 -2
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +64 -22
- package/esm/gates/mod.d.ts +2 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +17 -2
- package/esm/gherkin/load.d.ts +35 -0
- package/esm/gherkin/load.d.ts.map +1 -0
- package/esm/gherkin/load.js +39 -0
- package/esm/gherkin/parse.d.ts +11 -0
- package/esm/gherkin/parse.d.ts.map +1 -0
- package/esm/gherkin/parse.js +311 -0
- package/esm/gherkin/position.d.ts +23 -0
- package/esm/gherkin/position.d.ts.map +1 -0
- package/esm/gherkin/position.js +21 -0
- package/esm/gherkin/procedure.d.ts +76 -0
- package/esm/gherkin/procedure.d.ts.map +1 -0
- package/esm/gherkin/procedure.js +164 -0
- package/esm/gherkin/project.d.ts +35 -0
- package/esm/gherkin/project.d.ts.map +1 -0
- package/esm/gherkin/project.js +64 -0
- package/esm/gherkin/role.d.ts +23 -0
- package/esm/gherkin/role.d.ts.map +1 -0
- package/esm/gherkin/role.js +28 -0
- package/esm/gherkin/types.d.ts +118 -0
- package/esm/gherkin/types.d.ts.map +1 -0
- package/esm/gherkin/types.js +12 -0
- package/esm/lock/acquire_compile.d.ts +12 -4
- package/esm/lock/acquire_compile.d.ts.map +1 -1
- package/esm/lock/acquire_compile.js +15 -5
- package/esm/lock/canonical_edges.d.ts +6 -2
- package/esm/lock/canonical_edges.d.ts.map +1 -1
- package/esm/lock/canonical_edges.js +10 -3
- package/esm/lock/model.d.ts +5 -0
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +2 -0
- package/esm/lock/resolve.d.ts +6 -2
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +36 -4
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +7 -1
- package/esm/mod.d.ts +23 -6
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +18 -5
- package/esm/model/mod.d.ts +42 -1
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +1 -1
- package/esm/model/relations.d.ts +9 -0
- package/esm/model/relations.d.ts.map +1 -1
- package/esm/model/relations.js +16 -1
- package/esm/parser/attributes.d.ts +82 -3
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +199 -32
- package/esm/parser/body_tokens.d.ts +1 -1
- package/esm/parser/body_tokens.d.ts.map +1 -1
- package/esm/parser/body_tokens.js +49 -35
- package/esm/parser/feature_file.d.ts +116 -0
- package/esm/parser/feature_file.d.ts.map +1 -0
- package/esm/parser/feature_file.js +540 -0
- package/esm/parser/markdown.d.ts +7 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +129 -40
- package/esm/parser/mod.d.ts +18 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +51 -0
- package/esm/parser/translate.d.ts.map +1 -1
- package/esm/parser/translate.js +5 -0
- package/esm/refs/mod.d.ts +2 -1
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +12 -4
- package/esm/refs/split.d.ts +58 -0
- package/esm/refs/split.d.ts.map +1 -0
- package/esm/refs/split.js +137 -0
- package/esm/reporter/mod.d.ts +7 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +113 -3
- package/esm/validator/attributes.d.ts.map +1 -1
- package/esm/validator/attributes.js +4 -1
- package/esm/validator/block_role.d.ts +40 -0
- package/esm/validator/block_role.d.ts.map +1 -0
- package/esm/validator/block_role.js +109 -0
- package/esm/validator/feature_ac.d.ts.map +1 -1
- package/esm/validator/feature_ac.js +6 -1
- package/esm/validator/feature_parse.d.ts +35 -0
- package/esm/validator/feature_parse.d.ts.map +1 -0
- package/esm/validator/feature_parse.js +69 -0
- package/esm/validator/locators.d.ts +36 -0
- package/esm/validator/locators.d.ts.map +1 -0
- package/esm/validator/locators.js +184 -0
- package/esm/validator/mod.d.ts +10 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +38 -14
- package/esm/validator/normalize.d.ts.map +1 -1
- package/esm/validator/normalize.js +8 -3
- package/esm/validator/per_type_attrs.d.ts +3 -3
- package/esm/validator/per_type_attrs.js +3 -3
- package/esm/validator/pipeline.d.ts +4 -12
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +24 -5
- package/esm/validator/procedure.d.ts +22 -0
- package/esm/validator/procedure.d.ts.map +1 -0
- package/esm/validator/procedure.js +58 -0
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +4 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +4 -1
- package/esm/validator/type_resolution.d.ts +5 -3
- package/esm/validator/type_resolution.d.ts.map +1 -1
- package/esm/validator/type_resolution.js +14 -2
- package/esm/validator/types.d.ts +11 -0
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +26 -4
- package/esm/validator/uxil_family.d.ts +1 -1
- package/package.json +3 -1
- package/script/ast/build.d.ts.map +1 -1
- package/script/ast/build.js +19 -5
- package/script/ast/equivalence.js +14 -2
- package/script/ast/nodes.d.ts +15 -3
- package/script/ast/nodes.d.ts.map +1 -1
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +18 -3
- package/script/compiler/mod.d.ts +34 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +110 -46
- package/script/compiler/schema.d.ts +3 -2
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +6 -3
- package/script/criteria/scenarios.d.ts +55 -0
- package/script/criteria/scenarios.d.ts.map +1 -0
- package/script/criteria/scenarios.js +139 -0
- package/script/discovery/mod.d.ts +20 -1
- package/script/discovery/mod.d.ts.map +1 -1
- package/script/discovery/mod.js +106 -17
- package/script/formatter/entry_body.d.ts +8 -5
- package/script/formatter/entry_body.d.ts.map +1 -1
- package/script/formatter/entry_body.js +12 -8
- package/script/formatter/feature_file.d.ts +40 -0
- package/script/formatter/feature_file.d.ts.map +1 -0
- package/script/formatter/feature_file.js +92 -0
- package/script/formatter/mod.d.ts +21 -2
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +63 -21
- package/script/gates/mod.d.ts +2 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +17 -2
- package/script/gherkin/load.d.ts +35 -0
- package/script/gherkin/load.d.ts.map +1 -0
- package/script/gherkin/load.js +76 -0
- package/script/gherkin/parse.d.ts +11 -0
- package/script/gherkin/parse.d.ts.map +1 -0
- package/script/gherkin/parse.js +314 -0
- package/script/gherkin/position.d.ts +23 -0
- package/script/gherkin/position.d.ts.map +1 -0
- package/script/gherkin/position.js +24 -0
- package/script/gherkin/procedure.d.ts +76 -0
- package/script/gherkin/procedure.d.ts.map +1 -0
- package/script/gherkin/procedure.js +169 -0
- package/script/gherkin/project.d.ts +35 -0
- package/script/gherkin/project.d.ts.map +1 -0
- package/script/gherkin/project.js +67 -0
- package/script/gherkin/role.d.ts +23 -0
- package/script/gherkin/role.d.ts.map +1 -0
- package/script/gherkin/role.js +31 -0
- package/script/gherkin/types.d.ts +118 -0
- package/script/gherkin/types.d.ts.map +1 -0
- package/script/gherkin/types.js +13 -0
- package/script/lock/acquire_compile.d.ts +12 -4
- package/script/lock/acquire_compile.d.ts.map +1 -1
- package/script/lock/acquire_compile.js +15 -5
- package/script/lock/canonical_edges.d.ts +6 -2
- package/script/lock/canonical_edges.d.ts.map +1 -1
- package/script/lock/canonical_edges.js +10 -3
- package/script/lock/model.d.ts +5 -0
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +2 -0
- package/script/lock/resolve.d.ts +6 -2
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +36 -4
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +7 -1
- package/script/mod.d.ts +23 -6
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +45 -6
- package/script/model/mod.d.ts +42 -1
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +2 -1
- package/script/model/relations.d.ts +9 -0
- package/script/model/relations.d.ts.map +1 -1
- package/script/model/relations.js +17 -1
- package/script/parser/attributes.d.ts +82 -3
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +205 -33
- package/script/parser/body_tokens.d.ts +1 -1
- package/script/parser/body_tokens.d.ts.map +1 -1
- package/script/parser/body_tokens.js +49 -35
- package/script/parser/feature_file.d.ts +116 -0
- package/script/parser/feature_file.d.ts.map +1 -0
- package/script/parser/feature_file.js +548 -0
- package/script/parser/markdown.d.ts +7 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +128 -39
- package/script/parser/mod.d.ts +18 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +52 -1
- package/script/parser/translate.d.ts.map +1 -1
- package/script/parser/translate.js +5 -0
- package/script/refs/mod.d.ts +2 -1
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +12 -4
- package/script/refs/split.d.ts +58 -0
- package/script/refs/split.d.ts.map +1 -0
- package/script/refs/split.js +145 -0
- package/script/reporter/mod.d.ts +7 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +113 -3
- package/script/validator/attributes.d.ts.map +1 -1
- package/script/validator/attributes.js +4 -1
- package/script/validator/block_role.d.ts +40 -0
- package/script/validator/block_role.d.ts.map +1 -0
- package/script/validator/block_role.js +112 -0
- package/script/validator/feature_ac.d.ts.map +1 -1
- package/script/validator/feature_ac.js +6 -1
- package/script/validator/feature_parse.d.ts +35 -0
- package/script/validator/feature_parse.d.ts.map +1 -0
- package/script/validator/feature_parse.js +73 -0
- package/script/validator/locators.d.ts +36 -0
- package/script/validator/locators.d.ts.map +1 -0
- package/script/validator/locators.js +188 -0
- package/script/validator/mod.d.ts +10 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +38 -14
- package/script/validator/normalize.d.ts.map +1 -1
- package/script/validator/normalize.js +8 -3
- package/script/validator/per_type_attrs.d.ts +3 -3
- package/script/validator/per_type_attrs.js +3 -3
- package/script/validator/pipeline.d.ts +4 -12
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +23 -5
- package/script/validator/procedure.d.ts +22 -0
- package/script/validator/procedure.d.ts.map +1 -0
- package/script/validator/procedure.js +61 -0
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +4 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +4 -1
- package/script/validator/type_resolution.d.ts +5 -3
- package/script/validator/type_resolution.d.ts.map +1 -1
- package/script/validator/type_resolution.js +14 -2
- package/script/validator/types.d.ts +11 -0
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +27 -4
- package/script/validator/uxil_family.d.ts +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/gherkin/load
|
|
3
|
+
*
|
|
4
|
+
* Lazy loader for the `@cucumber/gherkin` parser. The parser is imported
|
|
5
|
+
* dynamically, so commands that never read Gherkin blocks do not load it.
|
|
6
|
+
*/
|
|
7
|
+
import type { Dialect } from "@cucumber/gherkin";
|
|
8
|
+
import type { GherkinDocument } from "@cucumber/messages";
|
|
9
|
+
/** The parts of the Gherkin parser that MarkSpec uses. */
|
|
10
|
+
export interface GherkinApi {
|
|
11
|
+
/**
|
|
12
|
+
* Parse Gherkin source text. Builds a new parser for each call, because
|
|
13
|
+
* the parser keeps state. Throws the library's composite error when the
|
|
14
|
+
* text is not valid Gherkin.
|
|
15
|
+
*/
|
|
16
|
+
parse(text: string): GherkinDocument;
|
|
17
|
+
/** Language dialects, keyed by language code (for example `fr`). */
|
|
18
|
+
readonly dialects: Record<string, Dialect>;
|
|
19
|
+
}
|
|
20
|
+
/** The two parser modules, as the importer returns them. */
|
|
21
|
+
type ParserModules = [
|
|
22
|
+
typeof import("@cucumber/gherkin"),
|
|
23
|
+
typeof import("@cucumber/messages")
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Load the Gherkin parser. The result is cached; a failed load is not
|
|
27
|
+
* cached, so a later call tries again.
|
|
28
|
+
*
|
|
29
|
+
* @param importer - Replaces the module import. Internal, for tests.
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadGherkin(importer?: () => Promise<ParserModules>): Promise<GherkinApi>;
|
|
32
|
+
/** The parser when it is already loaded, otherwise `undefined`. */
|
|
33
|
+
export declare function loadedGherkin(): GherkinApi | undefined;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/gherkin/load.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D,0DAA0D;AAC1D,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAKD,4DAA4D;AAC5D,KAAK,aAAa,GAAG;IACnB,cAAc,mBAAmB,CAAC;IAClC,cAAc,oBAAoB,CAAC;CACpC,CAAC;AASF;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,QAAQ,GAAE,MAAM,OAAO,CAAC,aAAa,CAAiB,GACrD,OAAO,CAAC,UAAU,CAAC,CAuBrB;AAED,mEAAmE;AACnE,wBAAgB,aAAa,IAAI,UAAU,GAAG,SAAS,CAEtD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/gherkin/load
|
|
4
|
+
*
|
|
5
|
+
* Lazy loader for the `@cucumber/gherkin` parser. The parser is imported
|
|
6
|
+
* dynamically, so commands that never read Gherkin blocks do not load it.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
21
|
+
}) : function(o, v) {
|
|
22
|
+
o["default"] = v;
|
|
23
|
+
});
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.loadGherkin = loadGherkin;
|
|
43
|
+
exports.loadedGherkin = loadedGherkin;
|
|
44
|
+
let loaded;
|
|
45
|
+
let pending;
|
|
46
|
+
/** Imports the two parser modules. */
|
|
47
|
+
const importModules = () => Promise.all([
|
|
48
|
+
Promise.resolve().then(() => __importStar(require("@cucumber/gherkin"))),
|
|
49
|
+
Promise.resolve().then(() => __importStar(require("@cucumber/messages"))),
|
|
50
|
+
]);
|
|
51
|
+
/**
|
|
52
|
+
* Load the Gherkin parser. The result is cached; a failed load is not
|
|
53
|
+
* cached, so a later call tries again.
|
|
54
|
+
*
|
|
55
|
+
* @param importer - Replaces the module import. Internal, for tests.
|
|
56
|
+
*/
|
|
57
|
+
function loadGherkin(importer = importModules) {
|
|
58
|
+
if (loaded)
|
|
59
|
+
return Promise.resolve(loaded);
|
|
60
|
+
pending ??= importer().then(([{ AstBuilder, GherkinClassicTokenMatcher, Parser, dialects }, { IdGenerator },]) => {
|
|
61
|
+
const api = {
|
|
62
|
+
parse: (text) => new Parser(new AstBuilder(IdGenerator.incrementing()), new GherkinClassicTokenMatcher()).parse(text),
|
|
63
|
+
dialects,
|
|
64
|
+
};
|
|
65
|
+
loaded = api;
|
|
66
|
+
return api;
|
|
67
|
+
}).catch((err) => {
|
|
68
|
+
pending = undefined;
|
|
69
|
+
throw err;
|
|
70
|
+
});
|
|
71
|
+
return pending;
|
|
72
|
+
}
|
|
73
|
+
/** The parser when it is already loaded, otherwise `undefined`. */
|
|
74
|
+
function loadedGherkin() {
|
|
75
|
+
return loaded;
|
|
76
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/gherkin/parse
|
|
3
|
+
*
|
|
4
|
+
* Wraps, parses and normalizes one Gherkin block into a {@linkcode FeatureAst}.
|
|
5
|
+
* The function is pure: it takes the loaded parser as an argument.
|
|
6
|
+
*/
|
|
7
|
+
import type { GherkinApi } from "./load.js";
|
|
8
|
+
import type { FeatureParse } from "./types.js";
|
|
9
|
+
/** Parse and normalize one Gherkin block. */
|
|
10
|
+
export declare function parseFeature(api: GherkinApi, source: string): FeatureParse;
|
|
11
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/gherkin/parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAEV,YAAY,EAMb,MAAM,YAAY,CAAC;AA4DpB,6CAA6C;AAC7C,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY,CAoQ1E"}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/gherkin/parse
|
|
4
|
+
*
|
|
5
|
+
* Wraps, parses and normalizes one Gherkin block into a {@linkcode FeatureAst}.
|
|
6
|
+
* The function is pure: it takes the loaded parser as an argument.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.parseFeature = parseFeature;
|
|
10
|
+
const LANGUAGE_RE = /^\s*#\s*language\s*:\s*([A-Za-z-]+)\s*$/;
|
|
11
|
+
// `keywordType` values of `StepKeywordType` in `@cucumber/messages`.
|
|
12
|
+
const KEYWORD_BY_TYPE = {
|
|
13
|
+
Context: "given",
|
|
14
|
+
Action: "when",
|
|
15
|
+
Outcome: "then",
|
|
16
|
+
Unknown: "step",
|
|
17
|
+
};
|
|
18
|
+
function wrapSource(api, source) {
|
|
19
|
+
const lines = source.split("\n");
|
|
20
|
+
// The language comment may follow blank or comment lines, as in the parser.
|
|
21
|
+
let start = 0;
|
|
22
|
+
let language = "en";
|
|
23
|
+
let languageLine = 0;
|
|
24
|
+
for (let i = 0; i < lines.length; i++) {
|
|
25
|
+
const trimmed = lines[i].trim();
|
|
26
|
+
if (trimmed !== "" && !trimmed.startsWith("#"))
|
|
27
|
+
break;
|
|
28
|
+
const match = LANGUAGE_RE.exec(lines[i].replace(/\r$/, ""));
|
|
29
|
+
if (match) {
|
|
30
|
+
language = match[1];
|
|
31
|
+
start = i + 1;
|
|
32
|
+
languageLine = i + 1;
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const featureWords = api.dialects[language]?.feature ?? ["Feature"];
|
|
37
|
+
for (let i = start; i < lines.length; i++) {
|
|
38
|
+
const trimmed = lines[i].trim();
|
|
39
|
+
if (trimmed === "" || trimmed.startsWith("#") || trimmed.startsWith("@"))
|
|
40
|
+
continue;
|
|
41
|
+
if (featureWords.some((word) => trimmed.startsWith(`${word}:`))) {
|
|
42
|
+
return { text: source, language, syntheticLine: 0, languageLine };
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
const synthetic = `${featureWords[0]}:`;
|
|
47
|
+
const wrapped = [...lines.slice(0, start), synthetic, ...lines.slice(start)];
|
|
48
|
+
return {
|
|
49
|
+
text: wrapped.join("\n"),
|
|
50
|
+
language,
|
|
51
|
+
syntheticLine: start + 1,
|
|
52
|
+
languageLine,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Parse and normalize one Gherkin block. */
|
|
56
|
+
function parseFeature(api, source) {
|
|
57
|
+
const wrap = wrapSource(api, source);
|
|
58
|
+
const shift = (line) => wrap.syntheticLine > 0 && line > wrap.syntheticLine ? line - 1 : line;
|
|
59
|
+
let document;
|
|
60
|
+
try {
|
|
61
|
+
document = api.parse(wrap.text);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
const first = err
|
|
65
|
+
.errors?.[0];
|
|
66
|
+
const location = first?.location;
|
|
67
|
+
return {
|
|
68
|
+
ok: false,
|
|
69
|
+
line: location ? Math.max(1, shift(location.line)) : 1,
|
|
70
|
+
column: location?.column ?? 1,
|
|
71
|
+
message: first?.message ??
|
|
72
|
+
(err instanceof Error ? err.message : String(err)),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
const parsed = document.feature;
|
|
76
|
+
if (!parsed) {
|
|
77
|
+
return {
|
|
78
|
+
ok: false,
|
|
79
|
+
line: 1,
|
|
80
|
+
column: 1,
|
|
81
|
+
message: "no Feature found in the Gherkin block",
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const sourceLines = source.split("\n");
|
|
85
|
+
// Exclusive end column of a source line, after trailing whitespace.
|
|
86
|
+
const lineEnd = (line) => (sourceLines[line - 1] ?? "").trimEnd().length + 1;
|
|
87
|
+
const sections = [];
|
|
88
|
+
const synthetic = wrap.syntheticLine > 0;
|
|
89
|
+
const section = (keyword, at) => {
|
|
90
|
+
const line = shift(at.line);
|
|
91
|
+
const column = at.column ?? 1;
|
|
92
|
+
sections.push({
|
|
93
|
+
keyword,
|
|
94
|
+
range: {
|
|
95
|
+
start: { line, column },
|
|
96
|
+
end: { line, column: column + keyword.length + 1 },
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
if (!synthetic)
|
|
101
|
+
section(parsed.keyword, parsed.location);
|
|
102
|
+
const step = (s) => {
|
|
103
|
+
const keyword = s.keyword.trimEnd();
|
|
104
|
+
const startLine = shift(s.location.line);
|
|
105
|
+
const column = s.location.column ?? 1;
|
|
106
|
+
let endLine = startLine;
|
|
107
|
+
let endColumn = column + s.keyword.length + s.text.length;
|
|
108
|
+
if (s.docString) {
|
|
109
|
+
// The content cannot give the closing line: an empty doc string and
|
|
110
|
+
// one that holds a single blank line both have content "". Find the
|
|
111
|
+
// first line after the opening one that starts with the delimiter.
|
|
112
|
+
const open = shift(s.docString.location.line);
|
|
113
|
+
const delimiter = s.docString.delimiter;
|
|
114
|
+
let close = open + 1;
|
|
115
|
+
while (close < sourceLines.length &&
|
|
116
|
+
!(sourceLines[close - 1] ?? "").trimStart().startsWith(delimiter))
|
|
117
|
+
close++;
|
|
118
|
+
endLine = close;
|
|
119
|
+
endColumn = lineEnd(endLine);
|
|
120
|
+
}
|
|
121
|
+
if (s.dataTable) {
|
|
122
|
+
const last = s.dataTable.rows[s.dataTable.rows.length - 1];
|
|
123
|
+
if (last) {
|
|
124
|
+
endLine = shift(last.location.line);
|
|
125
|
+
endColumn = lineEnd(endLine);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
keyword,
|
|
130
|
+
normalized: normalizeStep(api, wrap.language, s),
|
|
131
|
+
text: s.text,
|
|
132
|
+
...(s.docString
|
|
133
|
+
? {
|
|
134
|
+
docString: {
|
|
135
|
+
...(s.docString.mediaType
|
|
136
|
+
? { mediaType: s.docString.mediaType }
|
|
137
|
+
: {}),
|
|
138
|
+
content: s.docString.content,
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
: {}),
|
|
142
|
+
...(s.dataTable
|
|
143
|
+
? {
|
|
144
|
+
dataTable: s.dataTable.rows.map((r) => r.cells.map((c) => c.value)),
|
|
145
|
+
}
|
|
146
|
+
: {}),
|
|
147
|
+
range: {
|
|
148
|
+
start: { line: startLine, column },
|
|
149
|
+
end: { line: endLine, column: endColumn },
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
const examples = (e) => {
|
|
154
|
+
section(e.keyword, e.location);
|
|
155
|
+
const rows = e.tableBody;
|
|
156
|
+
const lastRow = rows[rows.length - 1] ?? e.tableHeader;
|
|
157
|
+
const start = shift(e.location.line);
|
|
158
|
+
return {
|
|
159
|
+
name: e.name.trim(),
|
|
160
|
+
keyword: e.keyword,
|
|
161
|
+
tags: e.tags.map((t) => t.name),
|
|
162
|
+
header: e.tableHeader?.cells.map((c) => c.value) ?? [],
|
|
163
|
+
rows: rows.map((r) => r.cells.map((c) => c.value)),
|
|
164
|
+
range: {
|
|
165
|
+
start: { line: start, column: e.location.column ?? 1 },
|
|
166
|
+
end: lastRow
|
|
167
|
+
? {
|
|
168
|
+
line: shift(lastRow.location.line),
|
|
169
|
+
column: lineEnd(shift(lastRow.location.line)),
|
|
170
|
+
}
|
|
171
|
+
: {
|
|
172
|
+
line: start,
|
|
173
|
+
column: (e.location.column ?? 1) + e.keyword.length + 1,
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
const scenarios = [];
|
|
179
|
+
const scenario = (s, background, ruleName) => {
|
|
180
|
+
section(s.keyword, s.location);
|
|
181
|
+
const steps = s.steps.map(step);
|
|
182
|
+
const exs = s.examples.map(examples);
|
|
183
|
+
const start = shift(s.location.line);
|
|
184
|
+
const column = s.location.column ?? 1;
|
|
185
|
+
const tail = [...steps, ...exs].map((x) => x.range.end);
|
|
186
|
+
const end = tail.length > 0
|
|
187
|
+
? tail.reduce((a, b) => b.line > a.line || (b.line === a.line && b.column > a.column) ? b : a)
|
|
188
|
+
: { line: start, column: column + s.keyword.length + 1 };
|
|
189
|
+
// Last description line: the last text line of the scenario's own head,
|
|
190
|
+
// ignoring blank and comment lines.
|
|
191
|
+
let descriptionEndLine;
|
|
192
|
+
if (s.description.trim() !== "") {
|
|
193
|
+
// The description ends before the first step, the next tag line or the
|
|
194
|
+
// next structural keyword, whichever comes first.
|
|
195
|
+
let bound = steps[0]?.range.start.line ?? sourceLines.length + 1;
|
|
196
|
+
const dialect = api.dialects[wrap.language];
|
|
197
|
+
const words = dialect
|
|
198
|
+
? [
|
|
199
|
+
...dialect.feature,
|
|
200
|
+
...dialect.background,
|
|
201
|
+
...dialect.rule,
|
|
202
|
+
...dialect.scenario,
|
|
203
|
+
...dialect.scenarioOutline,
|
|
204
|
+
...dialect.examples,
|
|
205
|
+
]
|
|
206
|
+
: ["Feature", "Background", "Rule", "Scenario", "Examples"];
|
|
207
|
+
for (let line = start + 1; line < bound; line++) {
|
|
208
|
+
const text = (sourceLines[line - 1] ?? "").trim();
|
|
209
|
+
if (text.startsWith("@") || words.some((w) => text.startsWith(`${w}:`))) {
|
|
210
|
+
bound = line;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
for (let line = bound - 1; line > start; line--) {
|
|
215
|
+
const text = (sourceLines[line - 1] ?? "").trim();
|
|
216
|
+
if (text !== "" && !text.startsWith("#")) {
|
|
217
|
+
descriptionEndLine = line;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
scenarios.push({
|
|
223
|
+
name: s.name.trim(),
|
|
224
|
+
keyword: s.keyword,
|
|
225
|
+
tags: s.tags.map((t) => t.name),
|
|
226
|
+
...(ruleName !== undefined ? { ruleName } : {}),
|
|
227
|
+
description: s.description,
|
|
228
|
+
...(descriptionEndLine !== undefined ? { descriptionEndLine } : {}),
|
|
229
|
+
isOutline: s.examples.length > 0 ||
|
|
230
|
+
isOutlineKeyword(api, wrap.language, s.keyword),
|
|
231
|
+
background,
|
|
232
|
+
steps,
|
|
233
|
+
examples: exs,
|
|
234
|
+
range: { start: { line: start, column }, end },
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
const backgrounds = [];
|
|
238
|
+
const backgroundSteps = (b) => {
|
|
239
|
+
section(b.keyword, b.location);
|
|
240
|
+
const steps = b.steps.map(step);
|
|
241
|
+
backgrounds.push(...steps);
|
|
242
|
+
return steps;
|
|
243
|
+
};
|
|
244
|
+
let featureBackground = [];
|
|
245
|
+
for (const child of parsed.children) {
|
|
246
|
+
if (child.background) {
|
|
247
|
+
featureBackground = [
|
|
248
|
+
...featureBackground,
|
|
249
|
+
...backgroundSteps(child.background),
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
else if (child.scenario) {
|
|
253
|
+
scenario(child.scenario, featureBackground, undefined);
|
|
254
|
+
}
|
|
255
|
+
else if (child.rule) {
|
|
256
|
+
const rule = child.rule;
|
|
257
|
+
section(rule.keyword, rule.location);
|
|
258
|
+
let ruleBackground = featureBackground;
|
|
259
|
+
for (const inner of rule.children) {
|
|
260
|
+
if (inner.background) {
|
|
261
|
+
ruleBackground = [
|
|
262
|
+
...ruleBackground,
|
|
263
|
+
...backgroundSteps(inner.background),
|
|
264
|
+
];
|
|
265
|
+
}
|
|
266
|
+
else if (inner.scenario) {
|
|
267
|
+
scenario(inner.scenario, ruleBackground, rule.name.trim());
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
// The parser consumes a `# language:` header and does not list it as a
|
|
273
|
+
// comment, so it is added back at its own line.
|
|
274
|
+
const comments = document.comments.map((c) => ({
|
|
275
|
+
line: shift(c.location.line),
|
|
276
|
+
text: c.text.trim(),
|
|
277
|
+
}));
|
|
278
|
+
if (wrap.languageLine > 0 && !comments.some((c) => c.line === wrap.languageLine)) {
|
|
279
|
+
comments.push({
|
|
280
|
+
line: wrap.languageLine,
|
|
281
|
+
text: (sourceLines[wrap.languageLine - 1] ?? "").trim(),
|
|
282
|
+
});
|
|
283
|
+
comments.sort((a, b) => a.line - b.line);
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
ok: true,
|
|
287
|
+
feature: {
|
|
288
|
+
name: parsed.name.trim(),
|
|
289
|
+
keyword: parsed.keyword,
|
|
290
|
+
synthetic,
|
|
291
|
+
language: parsed.language || wrap.language,
|
|
292
|
+
description: parsed.description,
|
|
293
|
+
tags: parsed.tags.map((t) => t.name),
|
|
294
|
+
scenarios,
|
|
295
|
+
backgrounds,
|
|
296
|
+
sections,
|
|
297
|
+
comments,
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
function normalizeStep(api, language, s) {
|
|
302
|
+
const type = s.keywordType ?? "Unknown";
|
|
303
|
+
// The parser reports And and But alike as Conjunction. A dialect may use
|
|
304
|
+
// one word for both; such a word counts as `but` only when it is in the
|
|
305
|
+
// `but` table, so a shared word is normalized as `but`.
|
|
306
|
+
if (type !== "Conjunction")
|
|
307
|
+
return KEYWORD_BY_TYPE[type] ?? "step";
|
|
308
|
+
const but = api.dialects[language]?.but ?? ["But "];
|
|
309
|
+
return but.some((word) => word.trim() === s.keyword.trim()) ? "but" : "and";
|
|
310
|
+
}
|
|
311
|
+
function isOutlineKeyword(api, language, keyword) {
|
|
312
|
+
const outline = api.dialects[language]?.scenarioOutline ?? [];
|
|
313
|
+
return outline.includes(keyword);
|
|
314
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/gherkin/position
|
|
3
|
+
*
|
|
4
|
+
* Maps a position inside a Gherkin block to a line of the file.
|
|
5
|
+
*/
|
|
6
|
+
import type { GherkinRange } from "./types.js";
|
|
7
|
+
import type { Entry } from "../model/mod.js";
|
|
8
|
+
/**
|
|
9
|
+
* Return the 1-based file line of `sourceLine`, a 1-based line of the
|
|
10
|
+
* authored block text of `node` (the same lines `FeatureAst` ranges use).
|
|
11
|
+
* The result matches the lines `buildCriteria` reports and needs no further
|
|
12
|
+
* translation. In Markdown, `bodyStartLine` is a file line and `node.range`
|
|
13
|
+
* is relative to the body. In a source doc comment, `bodyStartLine` stays
|
|
14
|
+
* relative to the extracted comment text, and `translateEntryLocations`
|
|
15
|
+
* (`parser/translate.ts`) shifts `node.range` by the comment's file offset
|
|
16
|
+
* instead; the sum is the file line in both cases.
|
|
17
|
+
*/
|
|
18
|
+
export declare function featureFileLine(entry: Entry,
|
|
19
|
+
/** The feature block: a body-AST `FeatureNode`. */
|
|
20
|
+
node: {
|
|
21
|
+
readonly range: GherkinRange;
|
|
22
|
+
}, sourceLine: number): number;
|
|
23
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/gherkin/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK;AACZ,mDAAmD;AACnD,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAAE,EACtC,UAAU,EAAE,MAAM,GACjB,MAAM,CAGR"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/gherkin/position
|
|
4
|
+
*
|
|
5
|
+
* Maps a position inside a Gherkin block to a line of the file.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.featureFileLine = featureFileLine;
|
|
9
|
+
/**
|
|
10
|
+
* Return the 1-based file line of `sourceLine`, a 1-based line of the
|
|
11
|
+
* authored block text of `node` (the same lines `FeatureAst` ranges use).
|
|
12
|
+
* The result matches the lines `buildCriteria` reports and needs no further
|
|
13
|
+
* translation. In Markdown, `bodyStartLine` is a file line and `node.range`
|
|
14
|
+
* is relative to the body. In a source doc comment, `bodyStartLine` stays
|
|
15
|
+
* relative to the extracted comment text, and `translateEntryLocations`
|
|
16
|
+
* (`parser/translate.ts`) shifts `node.range` by the comment's file offset
|
|
17
|
+
* instead; the sum is the file line in both cases.
|
|
18
|
+
*/
|
|
19
|
+
function featureFileLine(entry,
|
|
20
|
+
/** The feature block: a body-AST `FeatureNode`. */
|
|
21
|
+
node, sourceLine) {
|
|
22
|
+
const bodyStart = entry.bodyStartLine ?? (entry.location.line + 1);
|
|
23
|
+
return bodyStart + node.range.start.line + sourceLine - 1;
|
|
24
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/gherkin/procedure
|
|
3
|
+
*
|
|
4
|
+
* Procedure view of a Gherkin scenario. This module resolves the role of each
|
|
5
|
+
* step (precondition, action or outcome). It is a pure function of the
|
|
6
|
+
* normalized AST; nothing is stored on the AST.
|
|
7
|
+
*/
|
|
8
|
+
import type { FeatureAst, GherkinComment, ScenarioAst, StepAst } from "./types.js";
|
|
9
|
+
/** What a step does in a procedure. */
|
|
10
|
+
export type StepRole = "precondition" | "action" | "outcome";
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the role of each step, in order.
|
|
13
|
+
*
|
|
14
|
+
* `Given` is a precondition, `When` is an action, `Then` is an outcome, and a
|
|
15
|
+
* `*` step is always an action. `And` and `But` take the role of the step
|
|
16
|
+
* before them; a first `And` or `But` is an action.
|
|
17
|
+
*/
|
|
18
|
+
export declare function stepRoles(steps: readonly StepAst[]): StepRole[];
|
|
19
|
+
/** A step of the scenario, with its resolved role and where it came from. */
|
|
20
|
+
export interface ProcedureStepRef {
|
|
21
|
+
readonly step: StepAst;
|
|
22
|
+
readonly role: StepRole;
|
|
23
|
+
readonly origin: "background" | "scenario";
|
|
24
|
+
}
|
|
25
|
+
/** One numbered step of a procedure: its setup, actions and expected results. */
|
|
26
|
+
export interface ProcedureStep {
|
|
27
|
+
/** 1-based position in the scenario. */
|
|
28
|
+
readonly n: number;
|
|
29
|
+
/**
|
|
30
|
+
* The `# Step` label above the step's first line, without the `#`
|
|
31
|
+
* (for example `Step 1`). Absent when the step has no label. It never
|
|
32
|
+
* changes `n`.
|
|
33
|
+
*/
|
|
34
|
+
readonly label?: string;
|
|
35
|
+
/** Preconditions that follow the first non-precondition step. */
|
|
36
|
+
readonly setup: readonly ProcedureStepRef[];
|
|
37
|
+
readonly actions: readonly ProcedureStepRef[];
|
|
38
|
+
readonly expected: readonly ProcedureStepRef[];
|
|
39
|
+
}
|
|
40
|
+
/** The procedure view of one scenario. */
|
|
41
|
+
export interface ScenarioProcedure {
|
|
42
|
+
/** Background steps, then the leading precondition steps of the scenario. */
|
|
43
|
+
readonly preconditions: readonly ProcedureStepRef[];
|
|
44
|
+
readonly steps: readonly ProcedureStep[];
|
|
45
|
+
/**
|
|
46
|
+
* `# Step` labels inside the scenario's range that do not label a step: one
|
|
47
|
+
* before a leading precondition or a step that does not open a procedure
|
|
48
|
+
* step, one with a description line between it and the step, one with no
|
|
49
|
+
* step after it (including one before `Examples:`), or a
|
|
50
|
+
* second label above the same step. Labels outside every scenario are
|
|
51
|
+
* reported by {@linkcode unplacedStepLabels}.
|
|
52
|
+
*/
|
|
53
|
+
readonly unplacedLabels: readonly GherkinComment[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Derive the procedure view of a scenario.
|
|
57
|
+
*
|
|
58
|
+
* Preconditions are the scenario's background steps followed by its leading
|
|
59
|
+
* precondition steps. The remaining steps are paired in order: an action after
|
|
60
|
+
* an expected result, or a precondition after an action or expected result,
|
|
61
|
+
* opens a new step. Examples of an outline are not expanded.
|
|
62
|
+
*
|
|
63
|
+
* `comments` are the block's comments. A `# Step` comment inside the
|
|
64
|
+
* scenario's range labels the procedure step that starts at the next step
|
|
65
|
+
* line; any other label is returned in `unplacedLabels`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function scenarioProcedure(scenario: ScenarioAst, comments?: readonly GherkinComment[]): ScenarioProcedure;
|
|
68
|
+
/**
|
|
69
|
+
* Every `# Step` label of a feature block that labels no step, each once, in
|
|
70
|
+
* document order. A label inside a scenario's range is unplaced when
|
|
71
|
+
* {@linkcode scenarioProcedure} leaves it unplaced; a label outside every
|
|
72
|
+
* scenario (in a Background, a Rule header, after a scenario's last step, or
|
|
73
|
+
* between scenarios) is always unplaced.
|
|
74
|
+
*/
|
|
75
|
+
export declare function unplacedStepLabels(feature: FeatureAst): GherkinComment[];
|
|
76
|
+
//# sourceMappingURL=procedure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/gherkin/procedure.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACR,MAAM,YAAY,CAAC;AAEpB,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE7D;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,GAAG,QAAQ,EAAE,CAyB/D;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;CAC5C;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,wCAAwC;IACxC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,iEAAiE;IACjE,QAAQ,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAChD;AAED,0CAA0C;AAC1C,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,QAAQ,CAAC,aAAa,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACpD,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IACzC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,cAAc,EAAE,CAAC;CACpD;AASD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,WAAW,EACrB,QAAQ,GAAE,SAAS,cAAc,EAAO,GACvC,iBAAiB,CAgFnB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,EAAE,CAiBxE"}
|