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
, // ~=
245 moduleString
, // __MODULE__
246 functionString
, // __FUNCTION__
247 prettyFunction
, // __PRETTY_FUNCTION__
259 endOfLine
, // \n, \r, \u2028, \u2029
282 // C only extended keywords
296 enum class EXP
: unsigned char
323 dotTemplateDeclaration
,
336 delegateFunctionPointer
,
355 unsignedRightShiftAssign
,
357 concatenateAssign
, // ~=
358 concatenateElemAssign
,
359 concatenateDcharAssign
,
421 moduleString
, // __MODULE__
422 functionString
, // __FUNCTION__
423 prettyFunction
, // __PRETTY_FUNCTION__
433 compoundLiteral
, // ( type-name ) { initializer-list }
440 #define TOKwild TOKinout
442 // Token has an anonymous struct, which is not strict ISO C++.
443 #if defined(__GNUC__)
444 #pragma GCC diagnostic push
445 #pragma GCC diagnostic ignored "-Wpedantic"
452 const utf8_t
*ptr
; // pointer to first character of this token within buffer
454 DString blockComment
; // doc comment string prior to this token
455 DString lineComment
; // doc comment for previous token
469 utf8_t
*ustring
; // UTF8 string
470 void *interpolatedSet
;
473 unsigned char postfix
; // 'c', 'w', 'd'
479 Token() : next(NULL
) {}
480 const char *toChars() const;
482 static const char *toChars(TOK value
);
485 #if defined(__GNUC__)
486 #pragma GCC diagnostic pop