mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-06-17 05:29:29 +00:00
Properly treat #line directive as giving the next line number, not the current one.
This commit is contained in:
parent
463da80902
commit
a6f1211ee6
|
@ -1837,6 +1837,7 @@ var
|
||||||
lReportEOL: boolean; {local copy of reportEOL}
|
lReportEOL: boolean; {local copy of reportEOL}
|
||||||
tSkipping: boolean; {temp copy of the skipping variable}
|
tSkipping: boolean; {temp copy of the skipping variable}
|
||||||
val: integer; {expression value}
|
val: integer; {expression value}
|
||||||
|
nextLineNumber: integer; {number for next line}
|
||||||
|
|
||||||
|
|
||||||
function Defined: boolean;
|
function Defined: boolean;
|
||||||
|
@ -2546,6 +2547,7 @@ lReportEOL := reportEOL; {we need to see eol's}
|
||||||
reportEOL := true;
|
reportEOL := true;
|
||||||
tSkipping := skipping; {don't skip the directive name!}
|
tSkipping := skipping; {don't skip the directive name!}
|
||||||
skipping := false;
|
skipping := false;
|
||||||
|
nextLineNumber := -1;
|
||||||
NextCh; {skip the '#' char}
|
NextCh; {skip the '#' char}
|
||||||
while charKinds[ord(ch)] = ch_white do {skip white space}
|
while charKinds[ord(ch)] = ch_white do {skip white space}
|
||||||
NextCh;
|
NextCh;
|
||||||
|
@ -2626,13 +2628,11 @@ if ch in ['a','d','e','i','l','p','u','w'] then begin
|
||||||
FlagPragmas(p_line);
|
FlagPragmas(p_line);
|
||||||
NextToken;
|
NextToken;
|
||||||
if token.kind = intconst then begin
|
if token.kind = intconst then begin
|
||||||
lineNumber := token.ival;
|
nextLineNumber := token.ival;
|
||||||
NextToken;
|
NextToken;
|
||||||
end {if}
|
end {if}
|
||||||
else
|
else
|
||||||
Error(18);
|
Error(18);
|
||||||
if lineNumber < 0 then
|
|
||||||
lineNumber := 0;
|
|
||||||
if token.kind = stringconst then begin
|
if token.kind = stringconst then begin
|
||||||
LongToPString(
|
LongToPString(
|
||||||
pointer(ord4(@sourceFileGS.theString)+1),
|
pointer(ord4(@sourceFileGS.theString)+1),
|
||||||
|
@ -2857,6 +2857,8 @@ charKinds[ord('#')] := illegal; {don't allow # as a token}
|
||||||
reportEOL := lReportEOL; {restore flags}
|
reportEOL := lReportEOL; {restore flags}
|
||||||
printMacroExpansions := lPrintMacroExpansions;
|
printMacroExpansions := lPrintMacroExpansions;
|
||||||
skipping := tskipping;
|
skipping := tskipping;
|
||||||
|
if nextLineNumber >= 0 then
|
||||||
|
lineNumber := nextLineNumber;
|
||||||
end; {PreProcess}
|
end; {PreProcess}
|
||||||
|
|
||||||
{-- Externally available routines ------------------------------}
|
{-- Externally available routines ------------------------------}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user