From a9f0564ba92170f573b0452692b9bd5a41d9c21e Mon Sep 17 00:00:00 2001 From: Kai Nacke Date: Mon, 6 Apr 2015 14:27:15 +0200 Subject: [PATCH] Add tokens for signed/unsigned 128bit integer values. Add the tokens to the token list and adds them to the parser where needed. Does not add a lexer for these values - they are unused. See https://github.com/ldc-developers/ldc/pull/891 for the use case. --- src/parse.c | 8 ++++++++ src/tokens.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/parse.c b/src/parse.c index af0ab438817c..b97286fac34f 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2792,6 +2792,8 @@ Objects *Parser::parseTemplateSingleArgument() case TOKuns32v: case TOKint64v: case TOKuns64v: + case TOKint128v: + case TOKuns128v: case TOKfloat32v: case TOKfloat64v: case TOKfloat80v: @@ -4482,6 +4484,8 @@ Statement *Parser::parseStatement(int flags, const utf8_t** endPtr, Loc *pEndloc case TOKuns32v: case TOKint64v: case TOKuns64v: + case TOKint128v: + case TOKuns128v: case TOKfloat32v: case TOKfloat64v: case TOKfloat80v: @@ -5676,6 +5680,8 @@ bool Parser::isBasicType(Token **pt) case TOKuns32v: case TOKint64v: case TOKuns64v: + case TOKint128v: + case TOKuns128v: case TOKfloat32v: case TOKfloat64v: case TOKfloat80v: @@ -7129,6 +7135,8 @@ Expression *Parser::parseUnaryExp() case TOKuns32v: case TOKint64v: case TOKuns64v: + case TOKint128v: + case TOKuns128v: case TOKfloat32v: case TOKfloat64v: case TOKfloat80v: diff --git a/src/tokens.h b/src/tokens.h index fbadfbb29254..c1ddec959aa6 100644 --- a/src/tokens.h +++ b/src/tokens.h @@ -107,6 +107,7 @@ enum TOK // Numeric literals TOKint32v, TOKuns32v, TOKint64v, TOKuns64v, + TOKint128v, TOKuns128v, TOKfloat32v, TOKfloat64v, TOKfloat80v, TOKimaginary32v, TOKimaginary64v, TOKimaginary80v, @@ -131,7 +132,7 @@ enum TOK TOKcomplex32, TOKcomplex64, TOKcomplex80, TOKchar, TOKwchar, TOKdchar, TOKbool, -// 157 +// 159 // Aggregates TOKstruct, TOKclass, TOKinterface, TOKunion, TOKenum, TOKimport, TOKtypedef, TOKalias, TOKoverride, TOKdelegate, TOKfunction,