occam-verify-cli 0.0.1137 → 0.0.1139
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/lib/context/bracketed/combinator.js +4 -3
- package/lib/context/bracketed/constructor.js +4 -3
- package/lib/context/bracketted.js +4 -16
- package/lib/{nodeAndTokens → context/partial}/metavariable.js +18 -18
- package/lib/{nodeAndTokens → context/partial}/statement.js +18 -18
- package/lib/{nodeAndTokens/substitution/statement.js → context/partial/substitution/frame.js} +16 -16
- package/lib/{nodeAndTokens/substitution/term.js → context/partial/substitution/reference.js} +16 -16
- package/lib/{nodeAndTokens/substitution/frame.js → context/partial/substitution/statement.js} +16 -16
- package/lib/{nodeAndTokens/substitution/reference.js → context/partial/substitution/term.js} +16 -16
- package/lib/{nodeAndTokens → context/partial}/term.js +19 -19
- package/lib/{nodeAndTokens → context/partial}/variable.js +19 -19
- package/lib/context/partial.js +93 -0
- package/lib/dom/metavariable.js +10 -10
- package/lib/dom/statement.js +3 -3
- package/lib/dom/term.js +2 -2
- package/lib/dom/variable.js +3 -3
- package/lib/log.js +1 -2
- package/lib/substitution/frame.js +3 -3
- package/lib/substitution/reference.js +3 -3
- package/lib/substitution/statement.js +5 -5
- package/lib/substitution/term.js +3 -3
- package/package.json +2 -2
- package/src/context/bracketed/combinator.js +7 -3
- package/src/context/bracketed/constructor.js +7 -3
- package/src/context/bracketted.js +3 -23
- package/src/context/partial/metavariable.js +39 -0
- package/src/context/partial/statement.js +39 -0
- package/src/context/partial/substitution/frame.js +18 -0
- package/src/context/partial/substitution/reference.js +18 -0
- package/src/context/partial/substitution/statement.js +18 -0
- package/src/context/partial/substitution/term.js +18 -0
- package/src/context/partial/term.js +49 -0
- package/src/context/partial/variable.js +49 -0
- package/src/{nodeAndTokens.js → context/partial.js} +5 -7
- package/src/dom/metavariable.js +14 -13
- package/src/dom/statement.js +6 -5
- package/src/dom/term.js +1 -1
- package/src/dom/variable.js +2 -2
- package/src/log.js +0 -2
- package/src/substitution/frame.js +6 -4
- package/src/substitution/reference.js +6 -4
- package/src/substitution/statement.js +16 -11
- package/src/substitution/term.js +6 -4
- package/lib/nodeAndTokens.js +0 -93
- package/lib/utilities/message.js +0 -52
- package/src/nodeAndTokens/metavariable.js +0 -37
- package/src/nodeAndTokens/statement.js +0 -37
- package/src/nodeAndTokens/substitution/frame.js +0 -18
- package/src/nodeAndTokens/substitution/reference.js +0 -18
- package/src/nodeAndTokens/substitution/statement.js +0 -18
- package/src/nodeAndTokens/substitution/term.js +0 -18
- package/src/nodeAndTokens/term.js +0 -45
- package/src/nodeAndTokens/variable.js +0 -45
- package/src/utilities/message.js +0 -49
package/src/dom/metavariable.js
CHANGED
|
@@ -5,7 +5,7 @@ import LocalContext from "../context/local";
|
|
|
5
5
|
import FrameSubstitution from "../substitution/frame";
|
|
6
6
|
import ReferenceSubstitution from "../substitution/reference";
|
|
7
7
|
import StatementSubstitution from "../substitution/statement";
|
|
8
|
-
import
|
|
8
|
+
import MetavariablePartialContext from "../context/partial/metavariable";
|
|
9
9
|
|
|
10
10
|
import { nodeQuery } from "../utilities/query";
|
|
11
11
|
import { objectType } from "../dom/type";
|
|
@@ -503,10 +503,11 @@ export default domAssigned(class Metavariable {
|
|
|
503
503
|
|
|
504
504
|
static fromJSON(json, fileContext) {
|
|
505
505
|
const { string } = json,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
506
|
+
lexer = fileContext.getLexer(),
|
|
507
|
+
parser = fileContext.getParser(),
|
|
508
|
+
metavariablePartialContext = MetavariablePartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
509
|
+
metavariableTokens = metavariablePartialContext.getMetavariableTokens(),
|
|
510
|
+
metavariableNode = metavariablePartialContext.getMetavariableNode(),
|
|
510
511
|
metavariableName = metavariableNameFromMetavariableNode(metavariableNode),
|
|
511
512
|
name = metavariableName, ///
|
|
512
513
|
node = metavariableNode, ///
|
|
@@ -518,6 +519,14 @@ export default domAssigned(class Metavariable {
|
|
|
518
519
|
return metavariable;
|
|
519
520
|
}
|
|
520
521
|
|
|
522
|
+
static fromLabelNode(labelNode, context) {
|
|
523
|
+
const labelMetavariableNode = labelMetavariableNodeQuery(labelNode),
|
|
524
|
+
metavariableNode = labelMetavariableNode, ///
|
|
525
|
+
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
526
|
+
|
|
527
|
+
return metavariable;
|
|
528
|
+
}
|
|
529
|
+
|
|
521
530
|
static fromFrameNode(frameNode, context) {
|
|
522
531
|
let metavariable = null;
|
|
523
532
|
|
|
@@ -532,14 +541,6 @@ export default domAssigned(class Metavariable {
|
|
|
532
541
|
return metavariable;
|
|
533
542
|
}
|
|
534
543
|
|
|
535
|
-
static fromLabelNode(labelNode, context) {
|
|
536
|
-
const labelMetavariableNode = labelMetavariableNodeQuery(labelNode),
|
|
537
|
-
metavariableNode = labelMetavariableNode, ///
|
|
538
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
539
|
-
|
|
540
|
-
return metavariable;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
544
|
static fromReferenceNode(referenceNode, context) {
|
|
544
545
|
const referenceMetavariableNode = referenceMetavariableNodeQuery(referenceNode),
|
|
545
546
|
metavariableNode = referenceMetavariableNode, ///
|
package/src/dom/statement.js
CHANGED
|
@@ -5,7 +5,7 @@ import { arrayUtilities } from "necessary";
|
|
|
5
5
|
import dom from "../dom";
|
|
6
6
|
import verifyMixins from "../mixins/statement/verify";
|
|
7
7
|
import combinatorVerifier from "../verifier/combinator";
|
|
8
|
-
import
|
|
8
|
+
import StatementPartialContext from "../context/partial/statement";
|
|
9
9
|
|
|
10
10
|
import { domAssigned } from "../dom";
|
|
11
11
|
import { unifyStatement } from "../utilities/unification";
|
|
@@ -283,10 +283,11 @@ export default domAssigned(class Statement {
|
|
|
283
283
|
|
|
284
284
|
static fromJSON(json, fileContext) {
|
|
285
285
|
const { string } = json,
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
286
|
+
lexer = fileContext.getLexer(),
|
|
287
|
+
parser = fileContext.getParser(),
|
|
288
|
+
statementPartialContext = StatementPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
289
|
+
node = statementPartialContext.getNode(),
|
|
290
|
+
tokens = statementPartialContext.getTokens(),
|
|
290
291
|
statement = new Statement(string, node, tokens);
|
|
291
292
|
|
|
292
293
|
return statement;
|
package/src/dom/term.js
CHANGED
|
@@ -9,7 +9,7 @@ import constructorVerifier from "../verifier/constructor";
|
|
|
9
9
|
import { objectType } from "./type";
|
|
10
10
|
import { domAssigned } from "../dom";
|
|
11
11
|
import { nodeQuery, nodesQuery } from "../utilities/query"
|
|
12
|
-
import { termNodeFromTermString } from "../
|
|
12
|
+
import { termNodeFromTermString } from "../context/partial/term";
|
|
13
13
|
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
14
14
|
|
|
15
15
|
const { filter, compress } = arrayUtilities;
|
package/src/dom/variable.js
CHANGED
|
@@ -7,9 +7,9 @@ import TermSubstitution from "../substitution/term";
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
8
|
import { objectType } from "./type";
|
|
9
9
|
import { domAssigned } from "../dom";
|
|
10
|
-
import { variableNameFromVariableNode} from "../utilities/name";
|
|
11
10
|
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
12
|
-
import {
|
|
11
|
+
import { variableNameFromVariableNode } from "../utilities/name";
|
|
12
|
+
import { variableNodeFromVariableString } from "../context/partial/variable";
|
|
13
13
|
|
|
14
14
|
const termVariableNodeQuery = nodeQuery("/term/variable!"),
|
|
15
15
|
variableDeclarationTypeNodeQuery = nodeQuery("/variableDeclaration/type"),
|
package/src/log.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { levels } from "necessary";
|
|
4
4
|
|
|
5
|
-
import { leastLineIndexFromNodeAndTokens, greatestLineIndexFromNodeAndTokens } from "./utilities/message";
|
|
6
|
-
|
|
7
5
|
const { TRACE_LEVEL, DEBUG_LEVEL, INFO_LEVEL, WARNING_LEVEL, ERROR_LEVEL } = levels;
|
|
8
6
|
|
|
9
7
|
export default class Log {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
|
-
import
|
|
5
|
+
import FrameSubstitutionPartialContext from "../context/partial/substitution/frame";
|
|
6
6
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
8
|
|
|
@@ -56,9 +56,11 @@ export default class FrameSubstitution extends Substitution {
|
|
|
56
56
|
|
|
57
57
|
static fromFrameAndMetavariable(frame, metavariable, context) {
|
|
58
58
|
const string = stringFromFrameAndMetavariable(frame, metavariable),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
lexer = context.getLexer(),
|
|
60
|
+
parser = context.getParser(),
|
|
61
|
+
frameSubstitutionPartialContext = FrameSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
62
|
+
node = frameSubstitutionPartialContext.getNode(),
|
|
63
|
+
tokens = frameSubstitutionPartialContext.getTokens(),
|
|
62
64
|
frameSubstitution = new FrameSubstitution(string, node, tokens, frame, metavariable);
|
|
63
65
|
|
|
64
66
|
return frameSubstitution;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
|
-
import
|
|
5
|
+
import ReferenceSubstitutionPartialContext from "../context/partial/substitution/reference";
|
|
6
6
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
8
|
|
|
@@ -56,9 +56,11 @@ export default class ReferenceSubstitution extends Substitution {
|
|
|
56
56
|
|
|
57
57
|
static fromReferenceAndMetavariable(reference, metavariable, context) {
|
|
58
58
|
const string = stringFromReferenceAndMetavariable(reference, metavariable),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
lexer = context.getLexer(),
|
|
60
|
+
parser = context.getParser(),
|
|
61
|
+
referenceSubstitutionPartialContext = ReferenceSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
62
|
+
node = referenceSubstitutionPartialContext.getNode(),
|
|
63
|
+
tokens = referenceSubstitutionPartialContext.getTokens(),
|
|
62
64
|
referenceSubstitution = new ReferenceSubstitution(string, node, tokens, reference, metavariable);
|
|
63
65
|
|
|
64
66
|
return referenceSubstitution;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
import Substitutions from "../substitutions";
|
|
5
|
-
import
|
|
5
|
+
import StatementSubstitutionPartialContext from "../context/partial/substitution/statement";
|
|
6
6
|
|
|
7
7
|
import { unifySubstitution } from "../utilities/unification";
|
|
8
8
|
import { stripBracketsFromStatement } from "../utilities/brackets";
|
|
@@ -165,10 +165,11 @@ export default class StatementSubstitution extends Substitution {
|
|
|
165
165
|
|
|
166
166
|
static fromJSON(json, fileContext) {
|
|
167
167
|
const { string } = json,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
lexer = fileContext.getLexer(),
|
|
169
|
+
parser = fileContext.getParser(),
|
|
170
|
+
statementSubstitutionPartialContext = StatementSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
171
|
+
node = statementSubstitutionPartialContext.getNode(),
|
|
172
|
+
tokens = statementSubstitutionPartialContext.getTokens(),
|
|
172
173
|
resolved = true,
|
|
173
174
|
statement = statementFromJSON(json, fileContext),
|
|
174
175
|
metavariable = metavariableFromJSON(json, fileContext),
|
|
@@ -182,9 +183,11 @@ export default class StatementSubstitution extends Substitution {
|
|
|
182
183
|
statement = stripBracketsFromStatement(statement, context); ///
|
|
183
184
|
|
|
184
185
|
const string = stringFromStatementAndMetavariable(statement, metavariable),
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
lexer = context.getLexer(),
|
|
187
|
+
parser = context.getParser(),
|
|
188
|
+
statementSubstitutionPartialContext = StatementSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
189
|
+
node = statementSubstitutionPartialContext.getNode(),
|
|
190
|
+
tokens = statementSubstitutionPartialContext.getTokens(),
|
|
188
191
|
resolved = true,
|
|
189
192
|
substitution = null,
|
|
190
193
|
statementSubstitution = new StatementSubstitution(string, node, tokens, resolved, statement, metavariable, substitution);
|
|
@@ -196,9 +199,11 @@ export default class StatementSubstitution extends Substitution {
|
|
|
196
199
|
statement = stripBracketsFromStatement(statement, context); ///
|
|
197
200
|
|
|
198
201
|
const string = stringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
+
lexer = context.getLexer(),
|
|
203
|
+
parser = context.getParser(),
|
|
204
|
+
statementSubstitutionPartialContext = StatementSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
205
|
+
node = statementSubstitutionPartialContext.getNode(),
|
|
206
|
+
tokens = statementSubstitutionPartialContext.getTokens(),
|
|
202
207
|
resolved = false,
|
|
203
208
|
statementSubstitution = new StatementSubstitution(string, node, tokens, resolved, statement, metavariable, substitution);
|
|
204
209
|
|
package/src/substitution/term.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../dom";
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
|
-
import
|
|
5
|
+
import TermSubstitutionPartialContext from "../context/partial/substitution/term";
|
|
6
6
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
8
|
import { stripBracketsFromTerm } from "../utilities/brackets";
|
|
@@ -90,9 +90,11 @@ export default class TermSubstitution extends Substitution {
|
|
|
90
90
|
term = Term.fromTermNode(termNode, context);
|
|
91
91
|
|
|
92
92
|
const string = stringFromTermAndVariable(term, variable),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
lexer = context.getLexer(),
|
|
94
|
+
parser = context.getParser(),
|
|
95
|
+
termSubstitutionPartialContext = TermSubstitutionPartialContext.fromStringLexerAndParser(string, lexer, parser),
|
|
96
|
+
node = termSubstitutionPartialContext.getNode(),
|
|
97
|
+
tokens = termSubstitutionPartialContext.getTokens(),
|
|
96
98
|
termSubstitution = new TermSubstitution(string, node, tokens, term, variable);
|
|
97
99
|
|
|
98
100
|
return termSubstitution;
|
package/lib/nodeAndTokens.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
default: function() {
|
|
13
|
-
return NodeAndTokens;
|
|
14
|
-
},
|
|
15
|
-
ruleFromBNF: function() {
|
|
16
|
-
return ruleFromBNF;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
var _occamlexers = require("occam-lexers");
|
|
20
|
-
var _occamparsers = require("occam-parsers");
|
|
21
|
-
var _necessary = require("necessary");
|
|
22
|
-
var _query = require("./utilities/query");
|
|
23
|
-
function _class_call_check(instance, Constructor) {
|
|
24
|
-
if (!(instance instanceof Constructor)) {
|
|
25
|
-
throw new TypeError("Cannot call a class as a function");
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _defineProperties(target, props) {
|
|
29
|
-
for(var i = 0; i < props.length; i++){
|
|
30
|
-
var descriptor = props[i];
|
|
31
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
32
|
-
descriptor.configurable = true;
|
|
33
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
34
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
38
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
39
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
40
|
-
return Constructor;
|
|
41
|
-
}
|
|
42
|
-
var first = _necessary.arrayUtilities.first;
|
|
43
|
-
var bnfLexer = _occamlexers.BNFLexer.fromNothing(), bnfParser = _occamparsers.BNFParser.fromNothing();
|
|
44
|
-
var childNodeQuery = (0, _query.nodeQuery)("/*/*!");
|
|
45
|
-
var NodeAndTokens = /*#__PURE__*/ function() {
|
|
46
|
-
function NodeAndTokens(node, tokens) {
|
|
47
|
-
_class_call_check(this, NodeAndTokens);
|
|
48
|
-
this.node = node;
|
|
49
|
-
this.tokens = tokens;
|
|
50
|
-
}
|
|
51
|
-
_create_class(NodeAndTokens, [
|
|
52
|
-
{
|
|
53
|
-
key: "getNode",
|
|
54
|
-
value: function getNode() {
|
|
55
|
-
return this.node;
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
key: "getTokens",
|
|
60
|
-
value: function getTokens() {
|
|
61
|
-
return this.tokens;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
], [
|
|
65
|
-
{
|
|
66
|
-
key: "fromString",
|
|
67
|
-
value: function fromString(Class, string, context) {
|
|
68
|
-
var rule = Class.rule, lexer = context.getLexer(), parser = context.getParser(), ruleMap = parser.getRuleMap(), ruleName = rule.getName();
|
|
69
|
-
ruleMap[ruleName] = rule;
|
|
70
|
-
var startRule = rule, content = "".concat(string, "\n");
|
|
71
|
-
var tokens = lexer.tokenise(content), node = parser.parse(tokens, startRule);
|
|
72
|
-
delete ruleMap[ruleName];
|
|
73
|
-
var childNode = childNodeQuery(node);
|
|
74
|
-
node = childNode; ///
|
|
75
|
-
tokens = tokensFromTokensAndNode(tokens, node); ///
|
|
76
|
-
var nodeAndTokens = new Class(node, tokens);
|
|
77
|
-
return nodeAndTokens;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
]);
|
|
81
|
-
return NodeAndTokens;
|
|
82
|
-
}();
|
|
83
|
-
function ruleFromBNF(bnf) {
|
|
84
|
-
var tokens = bnfLexer.tokensFromBNF(bnf), rules = bnfParser.rulesFromTokens(tokens), firstRule = first(rules), rule = firstRule; ///
|
|
85
|
-
return rule;
|
|
86
|
-
}
|
|
87
|
-
function tokensFromTokensAndNode(tokens, node) {
|
|
88
|
-
var lastSignificantTokenIndex = node.getLastSignificantTokenIndex(tokens), firstSignificantTokenIndex = node.getFirstSignificantTokenIndex(tokens), start = firstSignificantTokenIndex, end = lastSignificantTokenIndex + 1;
|
|
89
|
-
tokens = tokens.slice(start, end); ///
|
|
90
|
-
return tokens;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9ub2RlQW5kVG9rZW5zLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgeyBCTkZMZXhlciB9IGZyb20gXCJvY2NhbS1sZXhlcnNcIjtcbmltcG9ydCB7IEJORlBhcnNlciB9IGZyb20gXCJvY2NhbS1wYXJzZXJzXCI7XG5pbXBvcnQgeyBhcnJheVV0aWxpdGllcyB9IGZyb20gXCJuZWNlc3NhcnlcIjtcblxuaW1wb3J0IHsgbm9kZVF1ZXJ5IH0gZnJvbSBcIi4vdXRpbGl0aWVzL3F1ZXJ5XCI7XG5cbmNvbnN0IHsgZmlyc3QgfSA9IGFycmF5VXRpbGl0aWVzO1xuXG5jb25zdCBibmZMZXhlciA9IEJORkxleGVyLmZyb21Ob3RoaW5nKCksXG4gICAgICBibmZQYXJzZXIgPSBCTkZQYXJzZXIuZnJvbU5vdGhpbmcoKTtcblxuY29uc3QgY2hpbGROb2RlUXVlcnkgPSBub2RlUXVlcnkoXCIvKi8qIVwiKTtcblxuZXhwb3J0I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QUNELE1BQ2hDRSxRQUFROUIsVUFBVStCLGVBQWUsQ0FBQzFCLFNBQ2xDMkIsWUFBWXJDLE1BQU1tQyxRQUNsQmxCLE9BQU9vQixXQUFXLEdBQUc7SUFFM0IsT0FBT3BCO0FBQ1Q7QUFFQSxTQUFTYyx3QkFBd0JyQixNQUFNLEVBQUVELElBQUk7SUFDM0MsSUFBTTZCLDRCQUE0QjdCLEtBQUs4Qiw0QkFBNEIsQ0FBQzdCLFNBQzlEOEIsNkJBQTZCL0IsS0FBS2dDLDZCQUE2QixDQUFDL0IsU0FDaEVnQyxRQUFRRiw0QkFDUkcsTUFBTUwsNEJBQTRCO0lBRXhDNUIsU0FBU0EsT0FBT2tDLEtBQUssQ0FBQ0YsT0FBT0MsTUFBTyxHQUFHO0lBRXZDLE9BQU9qQztBQUNUIn0=
|
package/lib/utilities/message.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
greatestLineIndexFromNodeAndTokens: function() {
|
|
13
|
-
return greatestLineIndexFromNodeAndTokens;
|
|
14
|
-
},
|
|
15
|
-
leastLineIndexFromNodeAndTokens: function() {
|
|
16
|
-
return leastLineIndexFromNodeAndTokens;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function leastLineIndexFromNodeAndTokens(node, tokens) {
|
|
20
|
-
var leastLineIndex = undefined; ///
|
|
21
|
-
var firstSignificantTokenIndex = node.getFirstSignificantTokenIndex(tokens);
|
|
22
|
-
var lineIndex = 0;
|
|
23
|
-
tokens.some(function(token, tokenIndex) {
|
|
24
|
-
if (tokenIndex === firstSignificantTokenIndex) {
|
|
25
|
-
leastLineIndex = lineIndex; ///
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
var tokenEndOfLineToken = token.isEndOfLineToken();
|
|
29
|
-
if (tokenEndOfLineToken) {
|
|
30
|
-
lineIndex += 1;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
return leastLineIndex;
|
|
34
|
-
}
|
|
35
|
-
function greatestLineIndexFromNodeAndTokens(node, tokens) {
|
|
36
|
-
var greatestLineIndex = undefined; ///
|
|
37
|
-
var lastSignificantTokenIndex = node.getLastSignificantTokenIndex(tokens);
|
|
38
|
-
var lineIndex = 0;
|
|
39
|
-
tokens.some(function(token, tokenIndex) {
|
|
40
|
-
if (tokenIndex === lastSignificantTokenIndex) {
|
|
41
|
-
greatestLineIndex = lineIndex; ///
|
|
42
|
-
return true;
|
|
43
|
-
}
|
|
44
|
-
var tokenEndOfLineToken = token.isEndOfLineToken();
|
|
45
|
-
if (tokenEndOfLineToken) {
|
|
46
|
-
lineIndex += 1;
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
return greatestLineIndex;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvbWVzc2FnZS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGxlYXN0TGluZUluZGV4RnJvbU5vZGVBbmRUb2tlbnMobm9kZSwgdG9rZW5zKSB7XG4gIGxldCBsZWFzdExpbmVJbmRleCA9IHVuZGVmaW5lZDsgLy8vXG5cbiAgY29uc3QgZmlyc3RTaWduaWZpY2FudFRva2VuSW5kZXggPSBub2RlLmdldEZpcnN0U2lnbmlmaWNhbnRUb2tlbkluZGV4KHRva2Vucyk7XG5cbiAgbGV0IGxpbmVJbmRleCA9IDA7XG5cbiAgdG9rZW5zL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1Q7QUFFTyxTQUFTSixtQ0FBbUNFLElBQUksRUFBRUMsTUFBTTtJQUM3RCxJQUFJVyxvQkFBb0JULFdBQVksR0FBRztJQUV2QyxJQUFNVSw0QkFBNEJiLEtBQUtjLDRCQUE0QixDQUFDYjtJQUVwRSxJQUFJSyxZQUFZO0lBRWhCTCxPQUFPTSxJQUFJLENBQUMsU0FBQ0MsT0FBT0M7UUFDbEIsSUFBSUEsZUFBZUksMkJBQTJCO1lBQzVDRCxvQkFBb0JOLFdBQVksR0FBRztZQUVuQyxPQUFPO1FBQ1Q7UUFFQSxJQUFNSSxzQkFBc0JGLE1BQU1HLGdCQUFnQjtRQUVsRCxJQUFJRCxxQkFBcUI7WUFDdkJKLGFBQWE7UUFDZjtJQUNGO0lBRUEsT0FBT007QUFDVCJ9
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= metavariable... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class MetavariableNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
getMetavariableNode() {
|
|
16
|
-
const metavariableNode = this.node; ///
|
|
17
|
-
|
|
18
|
-
return metavariableNode;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getMetavariableTokens() {
|
|
22
|
-
const metavariableTokens = this.tokens; ///
|
|
23
|
-
|
|
24
|
-
return metavariableTokens;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static rule = rule;
|
|
28
|
-
|
|
29
|
-
static fromMetavariable(metavariable, context) {
|
|
30
|
-
const string = metavariable.getString(),
|
|
31
|
-
metavariableNodeAndTokens = NodeAndTokens.fromString(MetavariableNodeAndTokens, string, context);
|
|
32
|
-
|
|
33
|
-
return metavariableNodeAndTokens;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static fromString(string, context) { return NodeAndTokens.fromString(MetavariableNodeAndTokens, string, context); }
|
|
37
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= statement... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class StatementNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
getStatementNode() {
|
|
16
|
-
const statementNode = this.node; ///
|
|
17
|
-
|
|
18
|
-
return statementNode;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getStatementTokens() {
|
|
22
|
-
const statementTokens = this.tokens; ///
|
|
23
|
-
|
|
24
|
-
return statementTokens;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static rule = rule;
|
|
28
|
-
|
|
29
|
-
static fromStatement(statement, context) {
|
|
30
|
-
const string = statement.getString(),
|
|
31
|
-
statementNodeAndTokens = NodeAndTokens.fromString(StatementNodeAndTokens, string, context);
|
|
32
|
-
|
|
33
|
-
return statementNodeAndTokens;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static fromString(string, context) { return NodeAndTokens.fromString(StatementNodeAndTokens, string, context); }
|
|
37
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= frameSubstitution... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class FrameSubstitutionNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
static rule = rule;
|
|
16
|
-
|
|
17
|
-
static fromString(string, context) { return NodeAndTokens.fromString(FrameSubstitutionNodeAndTokens, string, context); }
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= referenceSubstitution... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class ReferenceSubstitutionNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
static rule = rule;
|
|
16
|
-
|
|
17
|
-
static fromString(string, context) { return NodeAndTokens.fromString(ReferenceSubstitutionNodeAndTokens, string, context); }
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= statementSubstitution... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class StatementSubstitutionNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
static rule = rule;
|
|
16
|
-
|
|
17
|
-
static fromString(string, context) { return NodeAndTokens.fromString(StatementSubstitutionNodeAndTokens, string, context); }
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= termSubstitution... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class TermSubstitutionNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
static rule = rule;
|
|
16
|
-
|
|
17
|
-
static fromString(string, context) { return NodeAndTokens.fromString(TermSubstitutionNodeAndTokens, string, context); }
|
|
18
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= term... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class TermNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
getTermNode() {
|
|
16
|
-
const termNode = this.node; ///
|
|
17
|
-
|
|
18
|
-
return termNode;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getTermTokens() {
|
|
22
|
-
const termTokens = this.tokens; ///
|
|
23
|
-
|
|
24
|
-
return termTokens;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static rule = rule;
|
|
28
|
-
|
|
29
|
-
static fromTerm(term, context) {
|
|
30
|
-
const string = term.getString(),
|
|
31
|
-
termNodeAndTokens = NodeAndTokens.fromString(TermNodeAndTokens, string, context);
|
|
32
|
-
|
|
33
|
-
return termNodeAndTokens;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static fromString(string, context) { return NodeAndTokens.fromString(TermNodeAndTokens, string, context); }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function termNodeFromTermString(termString, context) {
|
|
40
|
-
const string = termString, ///
|
|
41
|
-
termNodeAndTokens = TermNodeAndTokens.fromString(string, context),
|
|
42
|
-
termNode = termNodeAndTokens.getTermNode();
|
|
43
|
-
|
|
44
|
-
return termNode;
|
|
45
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import NodeAndTokens from "../nodeAndTokens";
|
|
4
|
-
|
|
5
|
-
import { ruleFromBNF } from "../nodeAndTokens";
|
|
6
|
-
|
|
7
|
-
const bnf = `
|
|
8
|
-
|
|
9
|
-
_ ::= variable... <END_OF_LINE> ;
|
|
10
|
-
|
|
11
|
-
`,
|
|
12
|
-
rule = ruleFromBNF(bnf);
|
|
13
|
-
|
|
14
|
-
export default class VariableNodeAndTokens extends NodeAndTokens {
|
|
15
|
-
getVariableNode() {
|
|
16
|
-
const variableNode = this.node; ///
|
|
17
|
-
|
|
18
|
-
return variableNode;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
getVariableTokens() {
|
|
22
|
-
const variableTokens = this.tokens; ///
|
|
23
|
-
|
|
24
|
-
return variableTokens;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static rule = rule;
|
|
28
|
-
|
|
29
|
-
static fromVariable(variable, context) {
|
|
30
|
-
const string = variable.getString(),
|
|
31
|
-
variableNodeAndTokens = NodeAndTokens.fromString(VariableNodeAndTokens, string, context);
|
|
32
|
-
|
|
33
|
-
return variableNodeAndTokens;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static fromString(string, context) { return NodeAndTokens.fromString(VariableNodeAndTokens, string, context); }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export function variableNodeFromVariableString(variableString, context) {
|
|
40
|
-
const string = variableString, ///
|
|
41
|
-
variableNodeAndTokens = VariableNodeAndTokens.fromString(string, context),
|
|
42
|
-
variableNode = variableNodeAndTokens.getVariableNode();
|
|
43
|
-
|
|
44
|
-
return variableNode;
|
|
45
|
-
}
|