Home | History | Annotate | Download | only in dmd

Lines Matching refs:Identifier

2  * Defines an identifier, which is the name of a `Dsymbol`.
7 * Source: $(LINK2 https://github.com/dlang/dmd/blob/master/src/dmd/identifier.d, _identifier.d)
9 * Coverage: https://codecov.io/gh/dlang/dmd/src/master/src/dmd/identifier.d
12 module dmd.identifier;
29 extern (C++) final class Identifier : RootObject
33 // Indicates if this is an identifier used for an anonymous symbol.
40 /// Construct an identifier from the given name.
43 //printf("Identifier('%s', %d)\n", name, value);
44 this(name.toDString(), TOK.identifier);
48 Construct an identifier from the given name.
51 name = the identifier name. There must be `'\0'` at `name[length]`.
53 value = Identifier value (e.g. `Id.unitTest`) or `TOK.identifier`
62 //printf("Identifier('%s', %d)\n", name, value);
69 //printf("Identifier('%.*s', %d)\n", cast(int)name.length, name.ptr, value);
75 //printf("Identifier('%.*s', %d, %d)\n", cast(int)name.length, name.ptr, value, isAnonymous);
81 static Identifier create(const(char)* name)
83 return new Identifier(name);
141 return DYNCAST.identifier;
144 private extern (D) __gshared StringTable!Identifier stringtable;
147 * Generates a new identifier.
150 * prefix = this will be the prefix of the name of the identifier. For debugging
153 extern(D) static Identifier generateId(const(char)[] prefix)
159 * Generates a new anonymous identifier.
162 * name = this will be part of the name of the identifier. For debugging
165 extern(D) static Identifier generateAnonymousId(const(char)[] name)
171 * Generates a new identifier.
174 * prefix = this will be the prefix of the name of the identifier. For debugging
176 * suffix = this will be the suffix of the name of the identifier. This is
177 * what makes the identifier unique
179 extern(D) static Identifier generateId(const(char)[] prefix, size_t suffix)
185 static Identifier generateId(const(char)* prefix, size_t length, size_t suffix)
190 // Generates a new, unique, suffix for an identifier.
197 extern(D) private static Identifier generateId(const(char)[] prefix, size_t suffix, bool isAnonymous)
206 * Generate deterministic named identifier based on a source location,
212 * prefix = first part of the identifier name.
213 * loc = source location to use in the identifier name.
215 * Identifier (inside Identifier.idPool) with deterministic name based
218 extern (D) static Identifier generateIdWithLoc(string prefix, const ref Loc loc)
270 * Create an identifier in the string table.
272 static Identifier idPool(const(char)* s, uint len)
277 extern (D) static Identifier idPool(const(char)[] s)
282 extern (D) private static Identifier idPool(const(char)[] s, bool isAnonymous)
288 id = new Identifier(sv.toString(), TOK.identifier, isAnonymous);
294 extern (D) static Identifier idPool(const(char)* s, size_t len, int value)
299 extern (D) static Identifier idPool(const(char)[] s, int value)
303 auto id = new Identifier(sv.toString(), value);
309 * Determine if string is a valid Identifier.
345 extern (D) static Identifier lookup(const(char)* s, size_t len)
350 extern (D) static Identifier lookup(const(char)[] s)