2 * Defines a `Dsymbol` for `version = identifier` and `debug = identifier` statements.
4 * Specification: $(LINK2 https://dlang.org/spec/version.html#version-specification, Version Specification),
5 * $(LINK2 https://dlang.org/spec/version.html#debug_specification, Debug Specification).
7 * Copyright: Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
8 * Authors: $(LINK2 https://www.digitalmars.com, Walter Bright)
9 * License: $(LINK2 https://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
10 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/dversion.d, _dversion.d)
11 * Documentation: https://dlang.org/phobos/dmd_dversion.html
12 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dversion.d
17 import dmd
.arraytypes
;
22 import dmd
.dsymbolsem
;
25 import dmd
.identifier
;
27 import dmd
.common
.outbuffer
;
30 /***********************************************************
31 * DebugSymbol's happen for statements like:
35 extern (C
++) final class DebugSymbol
: Dsymbol
39 extern (D
) this(const ref Loc loc
, Identifier ident
) @safe
44 extern (D
) this(const ref Loc loc
, uint level
) @safe
50 override DebugSymbol
syntaxCopy(Dsymbol s
)
53 auto ds = new DebugSymbol(loc
, ident
);
59 override const(char)* toChars() const nothrow
62 return ident
.toChars();
67 return buf
.extractChars();
71 override const(char)* kind() const nothrow
76 override inout(DebugSymbol
) isDebugSymbol() inout
81 override void accept(Visitor v
)
87 /***********************************************************
88 * VersionSymbol's happen for statements like:
89 * version = identifier;
92 extern (C
++) final class VersionSymbol
: Dsymbol
96 extern (D
) this(const ref Loc loc
, Identifier ident
) @safe
101 extern (D
) this(const ref Loc loc
, uint level
) @safe
107 override VersionSymbol
syntaxCopy(Dsymbol s
)
110 auto ds = ident ?
new VersionSymbol(loc
, ident
)
111 : new VersionSymbol(loc
, level
);
112 ds.comment
= comment
;
116 override const(char)* toChars() const nothrow
119 return ident
.toChars();
124 return buf
.extractChars();
128 override const(char)* kind() const nothrow
133 override inout(VersionSymbol
) isVersionSymbol() inout
138 override void accept(Visitor v
)