mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-03 10:29:41 +00:00
Merge branch 'master' into longlong
This commit is contained in:
commit
714b417261
@ -777,7 +777,7 @@ case p_opcode of
|
|||||||
|
|
||||||
m_bcc,m_bcs,m_beq,m_bmi,m_bne,m_bpl,m_bra,m_brl,m_bvs,m_clc,m_cmp_abs,
|
m_bcc,m_bcs,m_beq,m_bmi,m_bne,m_bpl,m_bra,m_brl,m_bvs,m_clc,m_cmp_abs,
|
||||||
m_cmp_dir,m_cmp_imm,m_cmp_s,m_cpx_imm,m_jml,m_pha,m_phb,m_phd,
|
m_cmp_dir,m_cmp_imm,m_cmp_s,m_cpx_imm,m_jml,m_pha,m_phb,m_phd,
|
||||||
m_phx,m_phy,m_plb,m_pld,m_rtl,m_rts,m_sec,m_tcs,m_tcd,d_add,d_pin,
|
m_phx,m_phy,m_plb,m_rtl,m_rts,m_sec,m_tcs,d_add,d_pin,
|
||||||
m_pei_dir,m_cpx_abs,m_cpx_dir,m_cmp_dirx,m_php,m_plp,m_cop,d_wrd: ;
|
m_pei_dir,m_cpx_abs,m_cpx_dir,m_cmp_dirx,m_php,m_plp,m_cop,d_wrd: ;
|
||||||
|
|
||||||
m_pea: begin
|
m_pea: begin
|
||||||
@ -810,7 +810,7 @@ case p_opcode of
|
|||||||
end; {if}
|
end; {if}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
m_sta_s: begin
|
m_sta_s,m_pld,m_tcd: begin
|
||||||
if aRegister.condition = regLocal then
|
if aRegister.condition = regLocal then
|
||||||
aRegister.condition := regUnknown;
|
aRegister.condition := regUnknown;
|
||||||
if xRegister.condition = regLocal then
|
if xRegister.condition = regLocal then
|
||||||
|
38
Scanner.pas
38
Scanner.pas
@ -685,6 +685,7 @@ if list or (numErr <> 0) then begin
|
|||||||
153: msg := @'lint: return statement in function declared _Noreturn';
|
153: msg := @'lint: return statement in function declared _Noreturn';
|
||||||
154: msg := @'lint: function declared _Noreturn can return or has unreachable code';
|
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';
|
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);
|
otherwise: Error(57);
|
||||||
end; {case}
|
end; {case}
|
||||||
writeln(msg^);
|
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}
|
while c2 in ['l','u','L','U'] do {check for long or unsigned}
|
||||||
if c2 in ['l','L'] then begin
|
if c2 in ['l','L'] then begin
|
||||||
NextChar;
|
NextChar;
|
||||||
if not isReal then
|
if isLong then
|
||||||
isLong := true;
|
FlagError(156);
|
||||||
|
isLong := true;
|
||||||
end {if}
|
end {if}
|
||||||
else {if c2 in ['u','U'] then} begin
|
else {if c2 in ['u','U'] then} begin
|
||||||
NextChar;
|
NextChar;
|
||||||
unsigned := true;
|
if unsigned then
|
||||||
if isReal then
|
FlagError(156)
|
||||||
|
else if isReal then
|
||||||
FlagError(91);
|
FlagError(91);
|
||||||
|
unsigned := true;
|
||||||
end; {else}
|
end; {else}
|
||||||
if c2 in ['f','F'] then begin {allow F designator on reals}
|
if c2 in ['f','F'] then begin {allow F designator on reals}
|
||||||
if unsigned then
|
if unsigned then
|
||||||
@ -3337,7 +3341,7 @@ else if numString[1] <> '0' then begin {convert a decimal integer}
|
|||||||
token.lval := Convertsl(numString);
|
token.lval := Convertsl(numString);
|
||||||
end; {else}
|
end; {else}
|
||||||
end {else if}
|
end {else if}
|
||||||
else begin {hex & octal}
|
else begin {hex, octal, & binary}
|
||||||
token.lval := 0;
|
token.lval := 0;
|
||||||
if isHex then begin
|
if isHex then begin
|
||||||
i := 3;
|
i := 3;
|
||||||
@ -3392,7 +3396,7 @@ else begin {hex & octal}
|
|||||||
if long(token.lval).msw <> 0 then
|
if long(token.lval).msw <> 0 then
|
||||||
isLong := true;
|
isLong := true;
|
||||||
if isLong then begin
|
if isLong then begin
|
||||||
if unsigned then
|
if unsigned or (token.lval & $80000000 <> 0) then
|
||||||
token.kind := ulongConst
|
token.kind := ulongConst
|
||||||
else
|
else
|
||||||
token.kind := longConst;
|
token.kind := longConst;
|
||||||
@ -3849,6 +3853,10 @@ repeat
|
|||||||
bp := pointer(ord4(macros) + hash(mp^.name));
|
bp := pointer(ord4(macros) + hash(mp^.name));
|
||||||
mp^.next := bp^;
|
mp^.next := bp^;
|
||||||
bp^ := mp;
|
bp^ := mp;
|
||||||
|
token.kind := intconst; {create the default value}
|
||||||
|
token.numString := nil;
|
||||||
|
token.class := intConstant;
|
||||||
|
token.ival := 1;
|
||||||
if lch = '=' then begin
|
if lch = '=' then begin
|
||||||
NextCh; {record the value}
|
NextCh; {record the value}
|
||||||
token.numString := nil;
|
token.numString := nil;
|
||||||
@ -3872,12 +3880,8 @@ repeat
|
|||||||
otherwise: ;
|
otherwise: ;
|
||||||
end; {case}
|
end; {case}
|
||||||
end {if}
|
end {if}
|
||||||
else begin
|
else
|
||||||
token.kind := intconst;
|
Error(108);
|
||||||
token.numString := nil;
|
|
||||||
token.class := intConstant;
|
|
||||||
token.ival := 0;
|
|
||||||
end; {else}
|
|
||||||
end {else if}
|
end {else if}
|
||||||
else if lch in ['.','0'..'9'] then begin
|
else if lch in ['.','0'..'9'] then begin
|
||||||
token.name := GetWord;
|
token.name := GetWord;
|
||||||
@ -3887,17 +3891,11 @@ repeat
|
|||||||
GetString
|
GetString
|
||||||
else
|
else
|
||||||
Error(108);
|
Error(108);
|
||||||
end {if}
|
end; {if}
|
||||||
else begin
|
|
||||||
token.kind := intconst; {create the default value}
|
|
||||||
token.numString := nil;
|
|
||||||
token.class := intConstant;
|
|
||||||
token.ival := 1;
|
|
||||||
end; {else}
|
|
||||||
new(mp^.tokens); {add the value to the definition}
|
new(mp^.tokens); {add the value to the definition}
|
||||||
with mp^.tokens^ do begin
|
with mp^.tokens^ do begin
|
||||||
next := nil;
|
next := nil;
|
||||||
tokenString := nil;
|
tokenString := @'';
|
||||||
expandEnabled := true;
|
expandEnabled := true;
|
||||||
tokenStart := nil;
|
tokenStart := nil;
|
||||||
tokenEnd := nil;
|
tokenEnd := nil;
|
||||||
|
Loading…
Reference in New Issue
Block a user