@rightcapital/phpdoc-parser 0.6.2-renovate-lock-file-maintenance.2572.1.0 → 0.6.2
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 +5 -4
- package/dist/index.d.ts +0 -85
- package/dist/index.js +0 -182
- package/dist/phpdoc-parser/ast/abstract-node-visitor.d.ts +0 -8
- package/dist/phpdoc-parser/ast/abstract-node-visitor.js +0 -18
- package/dist/phpdoc-parser/ast/base-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/base-node.js +0 -27
- package/dist/phpdoc-parser/ast/comment.d.ts +0 -7
- package/dist/phpdoc-parser/ast/comment.js +0 -14
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-item-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-item-node.js +0 -21
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/const-expr/const-expr-array-node.js +0 -17
- package/dist/phpdoc-parser/ast/const-expr/const-expr-false-node.d.ts +0 -5
- package/dist/phpdoc-parser/ast/const-expr/const-expr-false-node.js +0 -13
- package/dist/phpdoc-parser/ast/const-expr/const-expr-float-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/const-expr/const-expr-float-node.js +0 -17
- package/dist/phpdoc-parser/ast/const-expr/const-expr-integer-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/const-expr/const-expr-integer-node.js +0 -17
- package/dist/phpdoc-parser/ast/const-expr/const-expr-node.d.ts +0 -23
- package/dist/phpdoc-parser/ast/const-expr/const-expr-node.js +0 -40
- package/dist/phpdoc-parser/ast/const-expr/const-expr-null-node.d.ts +0 -5
- package/dist/phpdoc-parser/ast/const-expr/const-expr-null-node.js +0 -13
- package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.d.ts +0 -11
- package/dist/phpdoc-parser/ast/const-expr/const-expr-string-node.js +0 -48
- package/dist/phpdoc-parser/ast/const-expr/const-expr-true-node.d.ts +0 -5
- package/dist/phpdoc-parser/ast/const-expr/const-expr-true-node.js +0 -13
- package/dist/phpdoc-parser/ast/const-expr/const-fetch-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/const-expr/const-fetch-node.js +0 -21
- package/dist/phpdoc-parser/ast/node-traverser.d.ts +0 -11
- package/dist/phpdoc-parser/ast/node-traverser.js +0 -216
- package/dist/phpdoc-parser/ast/node-visitor/cloning-visitor.d.ts +0 -5
- package/dist/phpdoc-parser/ast/node-visitor/cloning-visitor.js +0 -14
- package/dist/phpdoc-parser/ast/node-visitor.d.ts +0 -11
- package/dist/phpdoc-parser/ast/node-visitor.js +0 -2
- package/dist/phpdoc-parser/ast/node.d.ts +0 -6
- package/dist/phpdoc-parser/ast/node.js +0 -2
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-method-value-node.d.ts +0 -13
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-method-value-node.js +0 -24
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-property-value-node.d.ts +0 -13
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-property-value-node.js +0 -24
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-value-node.d.ts +0 -12
- package/dist/phpdoc-parser/ast/php-doc/assert-tag-value-node.js +0 -23
- package/dist/phpdoc-parser/ast/php-doc/deprecated-tag-value-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/php-doc/deprecated-tag-value-node.js +0 -17
- package/dist/phpdoc-parser/ast/php-doc/extends-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/extends-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/generic-tag-value-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/php-doc/generic-tag-value-node.js +0 -17
- package/dist/phpdoc-parser/ast/php-doc/helpers.d.ts +0 -48
- package/dist/phpdoc-parser/ast/php-doc/helpers.js +0 -99
- package/dist/phpdoc-parser/ast/php-doc/implements-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/implements-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/invalid-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/invalid-tag-value-node.js +0 -33
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-node.d.ts +0 -15
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-node.js +0 -27
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-parameter-node.d.ts +0 -13
- package/dist/phpdoc-parser/ast/php-doc/method-tag-value-parameter-node.js +0 -27
- package/dist/phpdoc-parser/ast/php-doc/mixin-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/mixin-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/param-closure-this-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/param-closure-this-tag-value-node.js +0 -19
- package/dist/phpdoc-parser/ast/php-doc/param-immediately-invoked-callable-tag-value-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/php-doc/param-immediately-invoked-callable-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/param-later-invoked-callable-tag-value-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/php-doc/param-later-invoked-callable-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/param-out-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/param-out-tag-value-node.js +0 -19
- package/dist/phpdoc-parser/ast/php-doc/param-tag-value-node.d.ts +0 -12
- package/dist/phpdoc-parser/ast/php-doc/param-tag-value-node.js +0 -28
- package/dist/phpdoc-parser/ast/php-doc/php-doc-child-node.d.ts +0 -4
- package/dist/phpdoc-parser/ast/php-doc/php-doc-child-node.js +0 -10
- package/dist/phpdoc-parser/ast/php-doc/php-doc-node.d.ts +0 -36
- package/dist/phpdoc-parser/ast/php-doc/php-doc-node.js +0 -111
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-value-node.d.ts +0 -4
- package/dist/phpdoc-parser/ast/php-doc/php-doc-tag-value-node.js +0 -10
- package/dist/phpdoc-parser/ast/php-doc/php-doc-text-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/php-doc/php-doc-text-node.js +0 -17
- package/dist/phpdoc-parser/ast/php-doc/property-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/property-tag-value-node.js +0 -19
- package/dist/phpdoc-parser/ast/php-doc/pure-unless-callable-is-impure-tag-value-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/php-doc/pure-unless-callable-is-impure-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/require-extends-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/require-extends-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/require-implements-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/require-implements-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/return-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/return-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/sealed-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/sealed-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/self-out-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/self-out-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.d.ts +0 -12
- package/dist/phpdoc-parser/ast/php-doc/template-tag-value-node.js +0 -26
- package/dist/phpdoc-parser/ast/php-doc/throws-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/throws-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/type-alias-import-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/type-alias-import-tag-value-node.js +0 -22
- package/dist/phpdoc-parser/ast/php-doc/type-alias-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/type-alias-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/typeless-param-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/typeless-param-tag-value-node.js +0 -22
- package/dist/phpdoc-parser/ast/php-doc/uses-tag-value-node.d.ts +0 -9
- package/dist/phpdoc-parser/ast/php-doc/uses-tag-value-node.js +0 -18
- package/dist/phpdoc-parser/ast/php-doc/var-tag-value-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/php-doc/var-tag-value-node.js +0 -19
- package/dist/phpdoc-parser/ast/type/array-shape-item-node.d.ts +0 -13
- package/dist/phpdoc-parser/ast/type/array-shape-item-node.js +0 -22
- package/dist/phpdoc-parser/ast/type/array-shape-node.d.ts +0 -20
- package/dist/phpdoc-parser/ast/type/array-shape-node.js +0 -41
- package/dist/phpdoc-parser/ast/type/array-shape-unsealed-type-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/type/array-shape-unsealed-type-node.js +0 -21
- package/dist/phpdoc-parser/ast/type/array-type-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/type/array-type-node.js +0 -25
- package/dist/phpdoc-parser/ast/type/callable-type-node.d.ts +0 -13
- package/dist/phpdoc-parser/ast/type/callable-type-node.js +0 -26
- package/dist/phpdoc-parser/ast/type/callable-type-parameter-node.d.ts +0 -11
- package/dist/phpdoc-parser/ast/type/callable-type-parameter-node.js +0 -26
- package/dist/phpdoc-parser/ast/type/conditional-type-for-parameter-node.d.ts +0 -11
- package/dist/phpdoc-parser/ast/type/conditional-type-for-parameter-node.js +0 -21
- package/dist/phpdoc-parser/ast/type/conditional-type-node.d.ts +0 -11
- package/dist/phpdoc-parser/ast/type/conditional-type-node.js +0 -21
- package/dist/phpdoc-parser/ast/type/const-type-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/type/const-type-node.js +0 -17
- package/dist/phpdoc-parser/ast/type/generic-type-node.d.ts +0 -15
- package/dist/phpdoc-parser/ast/type/generic-type-node.js +0 -37
- package/dist/phpdoc-parser/ast/type/identifier-type-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/type/identifier-type-node.js +0 -17
- package/dist/phpdoc-parser/ast/type/intersection-type-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/type/intersection-type-node.js +0 -25
- package/dist/phpdoc-parser/ast/type/invalid-type-node.d.ts +0 -10
- package/dist/phpdoc-parser/ast/type/invalid-type-node.js +0 -29
- package/dist/phpdoc-parser/ast/type/nullable-type-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/type/nullable-type-node.js +0 -17
- package/dist/phpdoc-parser/ast/type/object-shape-item-node.d.ts +0 -11
- package/dist/phpdoc-parser/ast/type/object-shape-item-node.js +0 -22
- package/dist/phpdoc-parser/ast/type/object-shape-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/type/object-shape-node.js +0 -17
- package/dist/phpdoc-parser/ast/type/offset-access-type-node.d.ts +0 -8
- package/dist/phpdoc-parser/ast/type/offset-access-type-node.js +0 -26
- package/dist/phpdoc-parser/ast/type/this-type-node.d.ts +0 -5
- package/dist/phpdoc-parser/ast/type/this-type-node.js +0 -13
- package/dist/phpdoc-parser/ast/type/type-node.d.ts +0 -40
- package/dist/phpdoc-parser/ast/type/type-node.js +0 -64
- package/dist/phpdoc-parser/ast/type/union-type-node.d.ts +0 -7
- package/dist/phpdoc-parser/ast/type/union-type-node.js +0 -25
- package/dist/phpdoc-parser/ast/types.d.ts +0 -14
- package/dist/phpdoc-parser/ast/types.js +0 -19
- package/dist/phpdoc-parser/lexer/lexer.d.ts +0 -82
- package/dist/phpdoc-parser/lexer/lexer.js +0 -146
- package/dist/phpdoc-parser/parser/const-expr-parser.d.ts +0 -14
- package/dist/phpdoc-parser/parser/const-expr-parser.js +0 -132
- package/dist/phpdoc-parser/parser/node-collecting-visitor.d.ts +0 -7
- package/dist/phpdoc-parser/parser/node-collecting-visitor.js +0 -15
- package/dist/phpdoc-parser/parser/parser-exception.d.ts +0 -16
- package/dist/phpdoc-parser/parser/parser-exception.js +0 -44
- package/dist/phpdoc-parser/parser/php-doc-parser.d.ts +0 -49
- package/dist/phpdoc-parser/parser/php-doc-parser.js +0 -604
- package/dist/phpdoc-parser/parser/string-unescaper.d.ts +0 -6
- package/dist/phpdoc-parser/parser/string-unescaper.js +0 -41
- package/dist/phpdoc-parser/parser/token-iterator.d.ts +0 -44
- package/dist/phpdoc-parser/parser/token-iterator.js +0 -243
- package/dist/phpdoc-parser/parser/type-parser.d.ts +0 -47
- package/dist/phpdoc-parser/parser/type-parser.js +0 -706
- package/dist/phpdoc-parser/parser-config.d.ts +0 -10
- package/dist/phpdoc-parser/parser-config.js +0 -12
- package/dist/phpdoc-parser/printer/diff-elem.d.ts +0 -12
- package/dist/phpdoc-parser/printer/diff-elem.js +0 -19
- package/dist/phpdoc-parser/printer/differ.d.ts +0 -10
- package/dist/phpdoc-parser/printer/differ.js +0 -111
- package/dist/phpdoc-parser/printer/printer.d.ts +0 -20
- package/dist/phpdoc-parser/printer/printer.js +0 -612
- package/dist/phpdoc-parser/transpiler/helpers.d.ts +0 -10
- package/dist/phpdoc-parser/transpiler/helpers.js +0 -73
- package/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler.d.ts +0 -26
- package/dist/phpdoc-parser/transpiler/php-doc-to-typescript-type-transpiler.js +0 -122
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParserConfig = void 0;
|
|
4
|
-
class ParserConfig {
|
|
5
|
-
constructor(usedAttributes = {}) {
|
|
6
|
-
var _a, _b, _c;
|
|
7
|
-
this.useLinesAttributes = (_a = usedAttributes.lines) !== null && _a !== void 0 ? _a : false;
|
|
8
|
-
this.useIndexAttributes = (_b = usedAttributes.indexes) !== null && _b !== void 0 ? _b : false;
|
|
9
|
-
this.useCommentsAttributes = (_c = usedAttributes.comments) !== null && _c !== void 0 ? _c : false;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.ParserConfig = ParserConfig;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class DiffElem<EleType> {
|
|
2
|
-
type: DiffElemType;
|
|
3
|
-
old: EleType;
|
|
4
|
-
new: EleType;
|
|
5
|
-
constructor(type: DiffElemType, oldEle: EleType, newEle: EleType);
|
|
6
|
-
}
|
|
7
|
-
export declare enum DiffElemType {
|
|
8
|
-
KEEP = 1,
|
|
9
|
-
REMOVE = 2,
|
|
10
|
-
ADD = 3,
|
|
11
|
-
REPLACE = 4
|
|
12
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DiffElemType = exports.DiffElem = void 0;
|
|
4
|
-
class DiffElem {
|
|
5
|
-
constructor(type, oldEle, newEle) {
|
|
6
|
-
this.type = type;
|
|
7
|
-
this.type = type;
|
|
8
|
-
this.old = oldEle;
|
|
9
|
-
this.new = newEle;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.DiffElem = DiffElem;
|
|
13
|
-
var DiffElemType;
|
|
14
|
-
(function (DiffElemType) {
|
|
15
|
-
DiffElemType[DiffElemType["KEEP"] = 1] = "KEEP";
|
|
16
|
-
DiffElemType[DiffElemType["REMOVE"] = 2] = "REMOVE";
|
|
17
|
-
DiffElemType[DiffElemType["ADD"] = 3] = "ADD";
|
|
18
|
-
DiffElemType[DiffElemType["REPLACE"] = 4] = "REPLACE";
|
|
19
|
-
})(DiffElemType || (exports.DiffElemType = DiffElemType = {}));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DiffElem } from './diff-elem';
|
|
2
|
-
export declare class Differ<T> {
|
|
3
|
-
private isEqual;
|
|
4
|
-
constructor(isEqual: (a: T, b: T) => boolean);
|
|
5
|
-
diff(old: T[], newElements: T[]): DiffElem<T>[];
|
|
6
|
-
diffWithReplacements(old: T[], newElements: T[]): DiffElem<T>[];
|
|
7
|
-
private calculateTrace;
|
|
8
|
-
private extractDiff;
|
|
9
|
-
private coalesceReplacements;
|
|
10
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Differ = void 0;
|
|
4
|
-
const diff_elem_1 = require("./diff-elem");
|
|
5
|
-
class Differ {
|
|
6
|
-
constructor(isEqual) {
|
|
7
|
-
this.isEqual = isEqual;
|
|
8
|
-
}
|
|
9
|
-
diff(old, newElements) {
|
|
10
|
-
const [trace, x, y] = this.calculateTrace(old, newElements);
|
|
11
|
-
return this.extractDiff(trace, x, y, old, newElements);
|
|
12
|
-
}
|
|
13
|
-
diffWithReplacements(old, newElements) {
|
|
14
|
-
return this.coalesceReplacements(this.diff(old, newElements));
|
|
15
|
-
}
|
|
16
|
-
calculateTrace(old, newElements) {
|
|
17
|
-
const n = old.length;
|
|
18
|
-
const m = newElements.length;
|
|
19
|
-
const max = n + m;
|
|
20
|
-
const v = { 1: 0 };
|
|
21
|
-
const trace = [];
|
|
22
|
-
for (let d = 0; d <= max; d++) {
|
|
23
|
-
trace.push(Object.assign({}, v));
|
|
24
|
-
for (let k = -d; k <= d; k += 2) {
|
|
25
|
-
let x;
|
|
26
|
-
if (k === -d || (k !== d && v[k - 1] < v[k + 1])) {
|
|
27
|
-
x = v[k + 1];
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
x = v[k - 1] + 1;
|
|
31
|
-
}
|
|
32
|
-
let y = x - k;
|
|
33
|
-
while (x < n && y < m && this.isEqual(old[x], newElements[y])) {
|
|
34
|
-
x++;
|
|
35
|
-
y++;
|
|
36
|
-
}
|
|
37
|
-
v[k] = x;
|
|
38
|
-
if (x >= n && y >= m) {
|
|
39
|
-
return [trace, x, y];
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
throw new Error('Should not happen');
|
|
44
|
-
}
|
|
45
|
-
extractDiff(trace, x, y, old, newElements) {
|
|
46
|
-
const result = [];
|
|
47
|
-
for (let d = trace.length - 1; d >= 0; d--) {
|
|
48
|
-
const v = trace[d];
|
|
49
|
-
const k = x - y;
|
|
50
|
-
let prevK;
|
|
51
|
-
if (k === -d || (k !== d && v[k - 1] < v[k + 1])) {
|
|
52
|
-
prevK = k + 1;
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
prevK = k - 1;
|
|
56
|
-
}
|
|
57
|
-
const prevX = v[prevK];
|
|
58
|
-
const prevY = prevX - prevK;
|
|
59
|
-
while (x > prevX && y > prevY) {
|
|
60
|
-
result.push(new diff_elem_1.DiffElem(diff_elem_1.DiffElemType.KEEP, old[x - 1], newElements[y - 1]));
|
|
61
|
-
x--;
|
|
62
|
-
y--;
|
|
63
|
-
}
|
|
64
|
-
if (d === 0) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
while (x > prevX) {
|
|
68
|
-
result.push(new diff_elem_1.DiffElem(diff_elem_1.DiffElemType.REMOVE, old[x - 1], null));
|
|
69
|
-
x--;
|
|
70
|
-
}
|
|
71
|
-
while (y > prevY) {
|
|
72
|
-
result.push(new diff_elem_1.DiffElem(diff_elem_1.DiffElemType.ADD, null, newElements[y - 1]));
|
|
73
|
-
y--;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return result.reverse();
|
|
77
|
-
}
|
|
78
|
-
coalesceReplacements(diff) {
|
|
79
|
-
const newDiff = [];
|
|
80
|
-
const c = diff.length;
|
|
81
|
-
for (let i = 0; i < c; i++) {
|
|
82
|
-
const diffType = diff[i].type;
|
|
83
|
-
if (diffType !== diff_elem_1.DiffElemType.REMOVE) {
|
|
84
|
-
newDiff.push(diff[i]);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
let j = i;
|
|
88
|
-
while (j < c && diff[j].type === diff_elem_1.DiffElemType.REMOVE) {
|
|
89
|
-
j++;
|
|
90
|
-
}
|
|
91
|
-
let k = j;
|
|
92
|
-
while (k < c && diff[k].type === diff_elem_1.DiffElemType.ADD) {
|
|
93
|
-
k++;
|
|
94
|
-
}
|
|
95
|
-
if (j - i === k - j) {
|
|
96
|
-
const len = j - i;
|
|
97
|
-
for (let n = 0; n < len; n++) {
|
|
98
|
-
newDiff.push(new diff_elem_1.DiffElem(diff_elem_1.DiffElemType.REPLACE, diff[i + n].old, diff[j + n].new));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
for (; i < k; i++) {
|
|
103
|
-
newDiff.push(diff[i]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
i = k - 1;
|
|
107
|
-
}
|
|
108
|
-
return newDiff;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.Differ = Differ;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseNode } from '../ast/base-node';
|
|
2
|
-
import { PhpDocNode } from '../ast/php-doc/php-doc-node';
|
|
3
|
-
import type { TokenIterator } from '../parser/token-iterator';
|
|
4
|
-
export declare class Printer {
|
|
5
|
-
private differ;
|
|
6
|
-
private listInsertionMap;
|
|
7
|
-
private emptyListInsertionMap;
|
|
8
|
-
private parenthesesMap;
|
|
9
|
-
private parenthesesListMap;
|
|
10
|
-
printFormatPreserving(node: PhpDocNode, originalNode: PhpDocNode, originalTokens: TokenIterator): string;
|
|
11
|
-
print(node: BaseNode): string;
|
|
12
|
-
private printTagValue;
|
|
13
|
-
private printType;
|
|
14
|
-
private wrapInParentheses;
|
|
15
|
-
private printOffsetAccessType;
|
|
16
|
-
private printConstExpr;
|
|
17
|
-
private printArrayFormatPreserving;
|
|
18
|
-
private isMultiline;
|
|
19
|
-
private printNodeFormatPreserving;
|
|
20
|
-
}
|