@@ -258,7 +258,11 @@ class AttributeArgument extends Element, @attribute_arg {
258
258
* Gets the text for the value of this argument, if its value is
259
259
* a constant or token.
260
260
*/
261
- string getValueText ( ) { attribute_arg_value ( underlyingElement ( this ) , result ) }
261
+ string getValueText ( ) {
262
+ if underlyingElement ( this ) instanceof @attribute_arg_constant_expr
263
+ then result = this .getValueConstant ( ) .getValue ( )
264
+ else attribute_arg_value ( underlyingElement ( this ) , result )
265
+ }
262
266
263
267
/**
264
268
* Gets the value of this argument, if its value is integral.
@@ -270,6 +274,13 @@ class AttributeArgument extends Element, @attribute_arg {
270
274
*/
271
275
Type getValueType ( ) { attribute_arg_type ( underlyingElement ( this ) , unresolveElement ( result ) ) }
272
276
277
+ /**
278
+ * Gets the value of this argument, if its value is a constant.
279
+ */
280
+ Expr getValueConstant ( ) {
281
+ attribute_arg_constant ( underlyingElement ( this ) , unresolveElement ( result ) )
282
+ }
283
+
273
284
/**
274
285
* Gets the attribute to which this is an argument.
275
286
*/
@@ -294,7 +305,10 @@ class AttributeArgument extends Element, @attribute_arg {
294
305
(
295
306
if underlyingElement ( this ) instanceof @attribute_arg_type
296
307
then tail = this .getValueType ( ) .getName ( )
297
- else tail = this .getValueText ( )
308
+ else
309
+ if underlyingElement ( this ) instanceof @attribute_arg_constant_expr
310
+ then tail = this .getValueConstant ( ) .toString ( )
311
+ else tail = this .getValueText ( )
298
312
) and
299
313
result = prefix + tail
300
314
)
0 commit comments