Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

dmd.tokens

Defines lexical tokens.

Specification Tokens

Authors:

Source tokens.d

enum EXP: ubyte;
Expression nodes
static immutable TOK[TOK.max + 1] Ckeywords;
This is used to pick the C keywords out of the tokens. If it's not a C keyword, then it's an identifier.
struct Token;
nothrow void setString(const(char)[] str);
Set to contents of str
Parameters:
const(char)[] str string
nothrow void toString(scope void delegate(ubyte c) nothrow sink) const;
Parameters:
void delegate(ubyte c) nothrow sink where the generated characters get sent
nothrow void writeCharLiteral(dchar d, scope void delegate(ubyte) nothrow sink);
Write a character, using a readable escape sequence if needed
Useful for printing "" string literals in e.g. error messages, ddoc, or the .stringof property
Parameters:
dchar d dchar to convert to literal
void delegate(ubyte) nothrow sink sink for generated characters
nothrow void writeSingleCharLiteral(dchar c, scope void delegate(ubyte c) nothrow sink);
Write a single-quoted character literal
Useful for printing '' char literals in e.g. error messages, ddoc, or the .stringof property
Parameters:
dchar c code point to write
void delegate(ubyte c) nothrow sink where the output goes