Parse _DecimalN keywords as (unsupported) type specifiers.

This gives a clearer error message when they are used and helps to keep the subsequent parsing on track.
This commit is contained in:
Stephen Heumann 2024-08-29 13:18:56 -05:00
parent f125a6640c
commit 1e415aadd7
2 changed files with 11 additions and 1 deletions

View File

@ -3270,6 +3270,15 @@ while token.kind in allowedTokens do begin
NextToken;
end;
_Decimal32sy,_Decimal64sy,_Decimal128sy: begin
Error(190);
if not typeDone then begin
myTypeSpec := doublePtr;
typeDone := true;
end; {if}
NextToken;
end;
enumsy: begin {enum}
if typeDone or (typeSpecifiers <> []) then
Error(badNextTokenError)
@ -4748,7 +4757,7 @@ anonNumber := 0; {no anonymous structs/unions yet}
typeSpecifierStart :=
[voidsy,charsy,shortsy,intsy,longsy,floatsy,doublesy,signedsy,unsignedsy,
extendedsy,compsy,_Boolsy,boolsy,_Complexsy,_Imaginarysy,_Atomicsy,
structsy,unionsy,enumsy,typedef];
_Decimal32sy,_Decimal64sy,_Decimal128sy,structsy,unionsy,enumsy,typedef];
storageClassSpecifiers :=
[typedefsy,externsy,staticsy,_Thread_localsy,thread_localsy,autosy,registersy];

View File

@ -819,6 +819,7 @@ if list or (numErr <> 0) then begin
187: msg := @'expression has incomplete struct or union type';
188: msg := @'local variable used in asm statement is out of range for addressing mode';
189: msg := @'malformed numeric constant';
190: msg := @'decimal floating types are not supported by ORCA/C';
end; {case}
if extraStr <> nil then begin
extraStr^ := concat(msg^,extraStr^);