mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Disallow duplicate suffixes on numeric constants (e.g. "123ulu").
This commit is contained in:
parent
8ac887f4dc
commit
1b9ee39de7
12
Scanner.pas
12
Scanner.pas
@ -685,6 +685,7 @@ if list or (numErr <> 0) then begin
|
||||
153: msg := @'lint: return statement in function declared _Noreturn';
|
||||
154: msg := @'lint: function declared _Noreturn can return or has unreachable code';
|
||||
155: msg := @'lint: non-void function may not return a value or has unreachable code';
|
||||
156: msg := @'invalid suffix on numeric constant';
|
||||
otherwise: Error(57);
|
||||
end; {case}
|
||||
writeln(msg^);
|
||||
@ -3277,14 +3278,17 @@ if c2 in ['e','E'] then begin {handle an exponent}
|
||||
while c2 in ['l','u','L','U'] do {check for long or unsigned}
|
||||
if c2 in ['l','L'] then begin
|
||||
NextChar;
|
||||
if not isReal then
|
||||
isLong := true;
|
||||
if isLong then
|
||||
FlagError(156);
|
||||
isLong := true;
|
||||
end {if}
|
||||
else {if c2 in ['u','U'] then} begin
|
||||
NextChar;
|
||||
unsigned := true;
|
||||
if isReal then
|
||||
if unsigned then
|
||||
FlagError(156)
|
||||
else if isReal then
|
||||
FlagError(91);
|
||||
unsigned := true;
|
||||
end; {else}
|
||||
if c2 in ['f','F'] then begin {allow F designator on reals}
|
||||
if unsigned then
|
||||
|
Loading…
Reference in New Issue
Block a user