Struct Attribute
A single node attribute.
struct Attribute
;
Attributes are key-value pairs, where the value can either be empty
(considered as a Boolean value of true
), a string with optional
string interpolations, or a D expression (stored as a single
interpolation
AttributeContent
).
Constructors
Name | Description |
---|---|
this
(loc, name, contents)
|
Fields
Name | Type | Description |
---|---|---|
contents
|
AttributeContent[] | Value of the attribute |
loc
|
Location | Location in source file |
name
|
string | Name of the attribute |
translationKey
|
string | For translated attributes, contains the attribute value expression as-is |
Properties
Name | Type | Description |
---|---|---|
dup [get]
|
Attribute | Creates a copy of the attribute. |
Methods
Name | Description |
---|---|
addContents
(contents)
|
Appends a list of contents. |
addText
(str)
|
Appends raw text to the attribute. |
expr
(name, value, loc)
|
Creates a new attribute with an expression based value. |
text
(name, value, loc)
|
Creates a new attribute with a static text value. |