mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-21 07:13:13 +01:00
Merge DMD r248: implement Denis Koroskin's macro suggestion
--- dmd/lexer.c | 2 +- dmd/lexer.h | 8 ++++---- dmd/mars.c | 2 +- dmd/parse.c | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-)
This commit is contained in:
@@ -210,7 +210,7 @@ const char *Token::toChars()
|
||||
case TOKenum:
|
||||
case TOKstruct:
|
||||
case TOKimport:
|
||||
CASE_BASIC_TYPES:
|
||||
case BASIC_TYPES:
|
||||
p = ident->toChars();
|
||||
break;
|
||||
|
||||
|
||||
@@ -171,8 +171,8 @@ enum TOK
|
||||
TOKMAX
|
||||
};
|
||||
|
||||
#define CASE_BASIC_TYPES \
|
||||
case TOKwchar: case TOKdchar: \
|
||||
#define BASIC_TYPES \
|
||||
TOKwchar: case TOKdchar: \
|
||||
case TOKbit: case TOKbool: case TOKchar: \
|
||||
case TOKint8: case TOKuns8: \
|
||||
case TOKint16: case TOKuns16: \
|
||||
@@ -183,8 +183,8 @@ enum TOK
|
||||
case TOKcomplex32: case TOKcomplex64: case TOKcomplex80: \
|
||||
case TOKvoid
|
||||
|
||||
#define CASE_BASIC_TYPES_X(t) \
|
||||
case TOKvoid: t = Type::tvoid; goto LabelX; \
|
||||
#define BASIC_TYPES_X(t) \
|
||||
TOKvoid: t = Type::tvoid; goto LabelX; \
|
||||
case TOKint8: t = Type::tint8; goto LabelX; \
|
||||
case TOKuns8: t = Type::tuns8; goto LabelX; \
|
||||
case TOKint16: t = Type::tint16; goto LabelX; \
|
||||
|
||||
@@ -58,7 +58,7 @@ Global::Global()
|
||||
|
||||
copyright = "Copyright (c) 1999-2009 by Digital Mars and Tomas Lindquist Olsen";
|
||||
written = "written by Walter Bright and Tomas Lindquist Olsen";
|
||||
version = "v1.052";
|
||||
version = "v1.053";
|
||||
ldc_version = LDC_REV;
|
||||
llvm_version = LLVM_REV_STR;
|
||||
global.structalign = 8;
|
||||
|
||||
12
dmd/parse.c
12
dmd/parse.c
@@ -195,7 +195,7 @@ Array *Parser::parseDeclDefs(int once)
|
||||
break;
|
||||
}
|
||||
|
||||
CASE_BASIC_TYPES:
|
||||
case BASIC_TYPES:
|
||||
case TOKalias:
|
||||
case TOKtypedef:
|
||||
case TOKidentifier:
|
||||
@@ -1778,7 +1778,7 @@ Type *Parser::parseBasicType()
|
||||
//printf("parseBasicType()\n");
|
||||
switch (token.value)
|
||||
{
|
||||
CASE_BASIC_TYPES_X(t):
|
||||
case BASIC_TYPES_X(t):
|
||||
nextToken();
|
||||
break;
|
||||
|
||||
@@ -2837,7 +2837,7 @@ Statement *Parser::parseStatement(int flags)
|
||||
goto Ldeclaration;
|
||||
}
|
||||
|
||||
CASE_BASIC_TYPES:
|
||||
case BASIC_TYPES:
|
||||
case TOKtypedef:
|
||||
case TOKalias:
|
||||
case TOKconst:
|
||||
@@ -3630,7 +3630,7 @@ int Parser::isBasicType(Token **pt)
|
||||
|
||||
switch (t->value)
|
||||
{
|
||||
CASE_BASIC_TYPES:
|
||||
case BASIC_TYPES:
|
||||
t = peek(t);
|
||||
break;
|
||||
|
||||
@@ -4270,7 +4270,7 @@ Expression *Parser::parsePrimaryExp()
|
||||
break;
|
||||
}
|
||||
|
||||
CASE_BASIC_TYPES_X(t):
|
||||
case BASIC_TYPES_X(t):
|
||||
nextToken();
|
||||
L1:
|
||||
check(TOKdot, t->toChars());
|
||||
@@ -4766,7 +4766,7 @@ Expression *Parser::parseUnaryExp()
|
||||
case TOKfile:
|
||||
case TOKline:
|
||||
#endif
|
||||
CASE_BASIC_TYPES: // (type)int.size
|
||||
case BASIC_TYPES: // (type)int.size
|
||||
{ // (type) una_exp
|
||||
Type *t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user