diff options
| -rw-r--r-- | src/ast.c | 6 | ||||
| -rw-r--r-- | src/ast.h | 3 | ||||
| -rw-r--r-- | src/parse.c | 6 |
3 files changed, 15 insertions, 0 deletions
@@ -29,6 +29,12 @@ const char* type_kind_stringify(TypeKind k) { return "long long"; else if (k == TypeKind_ullong) return "unsigned long long"; + else if (k == TypeKind_float) + return "float"; + else if (k == TypeKind_double) + return "double"; + else if (k == TypeKind_ldouble) + return "long double"; else if (k == TypeKind_struct) return "struct"; else if (k == TypeKind_union) @@ -29,6 +29,9 @@ typedef enum { TypeKind_ulong, TypeKind_llong, TypeKind_ullong, + TypeKind_float, + TypeKind_double, + TypeKind_ldouble, TypeKind_struct, TypeKind_union, TypeKind_enum, diff --git a/src/parse.c b/src/parse.c index ecd8e65..9c5eaff 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1605,6 +1605,12 @@ static Type* distinguish_type_from_type_specifiers(int type_specifiers) { type_specifiers == (TypeSpecifierMask_unsigned + TypeSpecifierMask_long + TypeSpecifierMask_long + TypeSpecifierMask_int)) { return type_new(TypeKind_ullong); + } else if (type_specifiers == TypeSpecifierMask_float) { + return type_new(TypeKind_float); + } else if (type_specifiers == TypeSpecifierMask_double) { + return type_new(TypeKind_double); + } else if (type_specifiers == TypeSpecifierMask_long + TypeSpecifierMask_double) { + return type_new(TypeKind_ldouble); } else if (type_specifiers == TypeSpecifierMask_struct) { return NULL; } else if (type_specifiers == TypeSpecifierMask_union) { |
