2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * https://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * https://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/dlang/dmd/blob/master/src/dmd/tokens.h
13 #include "root/dcompat.h"
14 #include "root/port.h"
23 < > <= >= == != === !==
24 << >> <<= >>= >>> >>>=
35 enum class TOK
: unsigned char
85 unsignedRightShiftAssign
,
86 concatenateAssign
, // ~=
244 moduleString
, // __MODULE__
245 functionString
, // __FUNCTION__
246 prettyFunction
, // __PRETTY_FUNCTION__
258 endOfLine
, // \n, \r, \u2028, \u2029
281 // C only extended keywords
295 enum class EXP
: unsigned char
322 dotTemplateDeclaration
,
335 delegateFunctionPointer
,
354 unsignedRightShiftAssign
,
356 concatenateAssign
, // ~=
357 concatenateElemAssign
,
358 concatenateDcharAssign
,
419 moduleString
, // __MODULE__
420 functionString
, // __FUNCTION__
421 prettyFunction
, // __PRETTY_FUNCTION__
431 compoundLiteral
, // ( type-name ) { initializer-list }
438 #define TOKwild TOKinout
440 // Token has an anonymous struct, which is not strict ISO C++.
441 #if defined(__GNUC__)
442 #pragma GCC diagnostic push
443 #pragma GCC diagnostic ignored "-Wpedantic"
450 const utf8_t
*ptr
; // pointer to first character of this token within buffer
452 DString blockComment
; // doc comment string prior to this token
453 DString lineComment
; // doc comment for previous token
464 { utf8_t
*ustring
; // UTF8 string
466 unsigned char postfix
; // 'c', 'w', 'd'
472 Token() : next(NULL
) {}
473 const char *toChars() const;
475 static const char *toChars(TOK value
);
478 #if defined(__GNUC__)
479 #pragma GCC diagnostic pop