Class AtAttribute

User-defined @attribute attributes. Also includes @disable, @nogc, @live, etc. by simply having them be regular identifiers.

class AtAttribute
  : BaseNode ;

Fields

NameTypeDescription
argumentList ArgumentListSet for all of @identifier(argumentList), @templateInstance!T(argumentList) and @(argumentListInParens).
endLocation ulong
identifier TokenStructure!(ubyte,"import dparse.lexer:TokenTriviaFields,TriviaToken; mixin TokenTriviaFields;")For @identifier, the identifier part. Not set for @identifer!templateArgs, see templateInstance for that. This is however set for @identifier(regularArguments).
startLocation ulong
templateInstance TemplateInstanceWhen there is at least one template argument (@id!T or @id!(T, U), etc.), this is set instead of identifier. For regular @identifier or @fn(args) UDAs without template arguments, identifier is set instead.
templateSingleArgument TemplateSingleArgumentFor @int or @5, the part after the @. May only be a single token, may not be identifier (see identifier for that). Introduced with DMD 2.104.0
useParen boolTrue for @(argumentList) code, as well as @templateInstance!T(argumentList) and @identifier(argumentList).
tokens const(TokenStructure!(ubyte,"import dparse.lexer:TokenTriviaFields,TriviaToken; mixin TokenTriviaFields;"))[]List of tokens consumed by this AST node

Methods

NameDescription
accept (visitor)
token () Returns either identifier or templateSingleArgument, whichever is set, otherwise Token.init.