ref: 17de97a568d0c405dba08f9a5356fefcf687b3ac
parent: 4e4c6ff3b58ea36c945f4aeeb3357dca5ca6b080
author: Roberto E. Vargas Caballero <[email protected]>
date: Mon Sep 23 16:16:31 EDT 2013
Add complex types These types are thought for arithmetic with complex numbers, and they were added in the c99 standard.
--- a/decl.c
+++ b/decl.c
@@ -89,6 +89,7 @@
tp = storage(tp, yytoken);
break;
case UNSIGNED: case SIGNED:
+ case COMPLEX: case IMAGINARY:
case FLOAT: case DOUBLE: case BOOL:
case VOID: case CHAR: case SHORT:
case INT: case ENUM: case LONG:
--- a/keyword.c
+++ b/keyword.c
@@ -10,6 +10,7 @@
} keywords [] = {"auto", AUTO,
"break", BREAK,
"_Bool", CHAR,
+ "_Complex", COMPLEX,
"case", CASE,
"char", CHAR,
"const", CONST,
@@ -25,6 +26,7 @@
"goto", GOTO,
"if", IF,
"int", INT,
+ "_Imaginary", IMAGINARY,
"long", LONG,
"register", REGISTER,
"restricted", RESTRICT,
--- a/tokens.h
+++ b/tokens.h
@@ -10,7 +10,8 @@
enum tokens {
/* types */
INT = 1, CHAR, FLOAT, LONG, LLONG, SHORT, VOID, DOUBLE,
- LDOUBLE, STRUCT, UNION, ENUM, UTYPE, BOOL, ARY, PTR, FTN,
+ LDOUBLE, STRUCT, UNION, ENUM, BOOL, ARY, PTR, FTN,
+ COMPLEX, IMAGINARY,
/* storage specifier */
TYPEDEF, EXTERN, STATIC, AUTO, REGISTER,
/* type qualifier */