@@ -22,12 +22,14 @@ export abstract class LCEValue extends LCEConcept {
2222 */
2323export class LCEValueNull extends LCEValue {
2424 public static override conceptId = "null-value" ;
25+ public static readonly valueTypeId = "null" ;
26+
2527
2628 /**
2729 * @param kind indicates whether value is `undefined` or `null`
2830 */
2931 constructor ( public kind : "undefined" | "null" ) {
30- super ( "null" , new LCETypePrimitive ( kind ) ) ;
32+ super ( LCEValueNull . valueTypeId , new LCETypePrimitive ( kind ) ) ;
3133 }
3234}
3335
@@ -36,13 +38,14 @@ export class LCEValueNull extends LCEValue {
3638 */
3739export class LCEValueLiteral extends LCEValue {
3840 public static override conceptId = "literal-value" ;
41+ public static readonly valueTypeId = "literal" ;
3942
4043 /**
4144 * @param value the value of the literal
4245 */
4346 constructor ( public value : string | number | bigint | boolean | RegExp ) {
4447 super (
45- "literal" ,
48+ LCEValueLiteral . valueTypeId ,
4649 typeof value === "object" ? new LCETypeDeclared ( new FQN ( "RegExp" ) , [ ] ) : new LCETypePrimitive ( typeof value )
4750 ) ;
4851 }
@@ -53,12 +56,13 @@ export class LCEValueLiteral extends LCEValue {
5356 */
5457export class LCEValueDeclared extends LCEValue {
5558 public static override conceptId = "declared-value" ;
59+ public static readonly valueTypeId = "declared" ;
5660
5761 /**
5862 * @param fqn fully qualified name of the referenced variable/function/class (only global Fqn is used)
5963 */
6064 constructor ( type : LCEType , public fqn : FQN ) {
61- super ( "declared" , type ) ;
65+ super ( LCEValueDeclared . valueTypeId , type ) ;
6266 }
6367}
6468
@@ -67,13 +71,14 @@ export class LCEValueDeclared extends LCEValue {
6771 */
6872export class LCEValueMember extends LCEValue {
6973 public static override conceptId = "member-value" ;
74+ public static readonly valueTypeId = "member" ;
7075
7176 /**
7277 * @param parent parent value of which a member is accessed
7378 * @param member member value which is accessed
7479 */
7580 constructor ( type : LCEType , public parent : LCEValue , public member : LCEValue ) {
76- super ( "member" , type ) ;
81+ super ( LCEValueMember . valueTypeId , type ) ;
7782 }
7883}
7984
@@ -82,12 +87,13 @@ export class LCEValueMember extends LCEValue {
8287 */
8388export class LCEValueObject extends LCEValue {
8489 public static override conceptId = "object-value" ;
90+ public static readonly valueTypeId = "object" ;
8591
8692 /**
8793 * @param members map of the object member's names to their respective values
8894 */
8995 constructor ( type : LCEType , public members : Map < string , LCEValue > ) {
90- super ( "object" , type ) ;
96+ super ( LCEValueObject . valueTypeId , type ) ;
9197 }
9298}
9399
@@ -97,13 +103,14 @@ export class LCEValueObject extends LCEValue {
97103 */
98104export class LCEValueObjectProperty extends LCEValue {
99105 public static override conceptId = "object-value-property" ;
106+ public static readonly valueTypeId = "object-property" ;
100107
101108 /**
102109 * @param name name of the property
103110 * @param value value of the property
104111 */
105112 constructor ( public name : string , public value : LCEValue ) {
106- super ( "object-property" , value . type ) ;
113+ super ( LCEValueObjectProperty . valueTypeId , value . type ) ;
107114 }
108115}
109116
@@ -112,12 +119,13 @@ export class LCEValueObjectProperty extends LCEValue {
112119 */
113120export class LCEValueArray extends LCEValue {
114121 public static override conceptId = "array-value" ;
122+ public static readonly valueTypeId = "array" ;
115123
116124 /**
117125 * @param items item values of the array
118126 */
119127 constructor ( type : LCEType , public items : LCEValue [ ] ) {
120- super ( "array" , type ) ;
128+ super ( LCEValueArray . valueTypeId , type ) ;
121129 }
122130}
123131
@@ -126,6 +134,7 @@ export class LCEValueArray extends LCEValue {
126134 */
127135export class LCEValueCall extends LCEValue {
128136 public static override conceptId = "call-value" ;
137+ public static readonly valueTypeId = "call" ;
129138
130139 /**
131140 * @param type return type of the call
@@ -134,7 +143,7 @@ export class LCEValueCall extends LCEValue {
134143 * @param typeArgs type arguments specified for call
135144 */
136145 constructor ( type : LCEType , public callee : LCEValue , public args : LCEValue [ ] , public typeArgs : LCEType [ ] ) {
137- super ( "call" , type ) ;
146+ super ( LCEValueCall . valueTypeId , type ) ;
138147 }
139148}
140149
@@ -143,13 +152,14 @@ export class LCEValueCall extends LCEValue {
143152 */
144153export class LCEValueFunction extends LCEValue {
145154 public static override conceptId = "function-value" ;
155+ public static readonly valueTypeId = "function" ;
146156
147157 /**
148158 * @param type return type of the function
149159 * @param arrowFunction indicates whether the function is an arrow function
150160 */
151161 constructor ( type : LCEType , public arrowFunction : boolean ) {
152- super ( "function" , type ) ;
162+ super ( LCEValueFunction . valueTypeId , type ) ;
153163 }
154164}
155165
@@ -158,9 +168,10 @@ export class LCEValueFunction extends LCEValue {
158168 */
159169export class LCEValueClass extends LCEValue {
160170 public static override conceptId = "class-value" ;
171+ public static readonly valueTypeId = "class" ;
161172
162173 constructor ( ) {
163- super ( "class" , new LCETypeNotIdentified ( "class expression" ) ) ;
174+ super ( LCEValueClass . valueTypeId , new LCETypeNotIdentified ( "class expression" ) ) ;
164175 }
165176}
166177
@@ -169,12 +180,13 @@ export class LCEValueClass extends LCEValue {
169180 */
170181export class LCEValueComplex extends LCEValue {
171182 public static override conceptId = "complex-value" ;
183+ public static readonly valueTypeId = "complex" ;
172184
173185 /**
174186 * @param expression string representation of the value's expression
175187 */
176188 constructor ( public expression : string ) {
177- super ( "complex" , new LCETypeNotIdentified ( "complex" ) ) ;
189+ super ( LCEValueComplex . valueTypeId , new LCETypeNotIdentified ( "complex" ) ) ;
178190 }
179191}
180192
0 commit comments