1 | var __extends = (this && this.__extends) || (function () {
|
2 | var extendStatics = function (d, b) {
|
3 | extendStatics = Object.setPrototypeOf ||
|
4 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
5 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
6 | return extendStatics(d, b);
|
7 | };
|
8 | return function (d, b) {
|
9 | extendStatics(d, b);
|
10 | function __() { this.constructor = d; }
|
11 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
12 | };
|
13 | })();
|
14 | import { DocNode } from './DocNode';
|
15 | import { StringChecks } from '../parser/StringChecks';
|
16 | import { DocExcerpt } from './DocExcerpt';
|
17 |
|
18 |
|
19 |
|
20 | var DocMemberIdentifier = (function (_super) {
|
21 | __extends(DocMemberIdentifier, _super);
|
22 | |
23 |
|
24 |
|
25 |
|
26 | function DocMemberIdentifier(parameters) {
|
27 | var _this = _super.call(this, parameters) || this;
|
28 | if (DocNode.isParsedParameters(parameters)) {
|
29 | if (parameters.leftQuoteExcerpt) {
|
30 | _this._leftQuoteExcerpt = new DocExcerpt({
|
31 | configuration: _this.configuration,
|
32 | excerptKind: "MemberIdentifier_LeftQuote" ,
|
33 | content: parameters.leftQuoteExcerpt
|
34 | });
|
35 | }
|
36 | _this._identifierExcerpt = new DocExcerpt({
|
37 | configuration: _this.configuration,
|
38 | excerptKind: "MemberIdentifier_Identifier" ,
|
39 | content: parameters.identifierExcerpt
|
40 | });
|
41 | if (parameters.rightQuoteExcerpt) {
|
42 | _this._rightQuoteExcerpt = new DocExcerpt({
|
43 | configuration: _this.configuration,
|
44 | excerptKind: "MemberIdentifier_RightQuote" ,
|
45 | content: parameters.rightQuoteExcerpt
|
46 | });
|
47 | }
|
48 | }
|
49 | else {
|
50 | _this._identifier = parameters.identifier;
|
51 | }
|
52 | return _this;
|
53 | }
|
54 | |
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | DocMemberIdentifier.isValidIdentifier = function (identifier) {
|
64 | return !StringChecks.explainIfInvalidUnquotedMemberIdentifier(identifier);
|
65 | };
|
66 | Object.defineProperty(DocMemberIdentifier.prototype, "kind", {
|
67 |
|
68 | get: function () {
|
69 | return "MemberIdentifier" ;
|
70 | },
|
71 | enumerable: false,
|
72 | configurable: true
|
73 | });
|
74 | Object.defineProperty(DocMemberIdentifier.prototype, "identifier", {
|
75 | |
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 | get: function () {
|
83 | if (this._identifier === undefined) {
|
84 | this._identifier = this._identifierExcerpt.content.toString();
|
85 | }
|
86 | return this._identifier;
|
87 | },
|
88 | enumerable: false,
|
89 | configurable: true
|
90 | });
|
91 | Object.defineProperty(DocMemberIdentifier.prototype, "hasQuotes", {
|
92 | |
93 |
|
94 |
|
95 |
|
96 |
|
97 | get: function () {
|
98 | if (this._identifierExcerpt) {
|
99 | return !!this._leftQuoteExcerpt;
|
100 | }
|
101 | else {
|
102 | return !DocMemberIdentifier.isValidIdentifier(this.identifier);
|
103 | }
|
104 | },
|
105 | enumerable: false,
|
106 | configurable: true
|
107 | });
|
108 |
|
109 | DocMemberIdentifier.prototype.onGetChildNodes = function () {
|
110 | return [this._leftQuoteExcerpt, this._identifierExcerpt, this._rightQuoteExcerpt];
|
111 | };
|
112 | return DocMemberIdentifier;
|
113 | }(DocNode));
|
114 | export { DocMemberIdentifier };
|
115 |
|
\ | No newline at end of file |