+ $IOCHECKS and $ALIGN to test already, other will follow soon

* fixed the wrong linecounting with comments
This commit is contained in:
peter 1998-04-29 13:42:27 +00:00
parent 99971ee924
commit 5ed869d75d
2 changed files with 52 additions and 29 deletions

View File

@ -26,11 +26,12 @@ type
directivestr=string[directivelen]; directivestr=string[directivelen];
tdirectivetoken=( tdirectivetoken=(
_DIR_NONE, _DIR_NONE,
_DIR_D,_DIR_DEFINE, _DIR_ALIGN,
_DIR_D,_DIR_DEFINE,_DIR_DESCRIPTION,
_DIR_ELSE,_DIR_ENDIF,_DIR_ERROR, _DIR_ELSE,_DIR_ENDIF,_DIR_ERROR,
_DIR_FATAL, _DIR_FATAL,
_DIR_I,_DIR_I386_ATT,_DIR_I386_DIRECT,_DIR_I386_INTEL,_DIR_IF,_DIR_IFDEF,_DIR_IFNDEF,_DIR_IFOPT, _DIR_I,_DIR_I386_ATT,_DIR_I386_DIRECT,_DIR_I386_INTEL,_DIR_IOCHECKS,
_DIR_INFO, _DIR_IF,_DIR_IFDEF,_DIR_IFNDEF,_DIR_IFOPT,_DIR_INFO,
_DIR_L,_DIR_LINKLIB, _DIR_L,_DIR_LINKLIB,
_DIR_MESSAGE,_DIR_MMX, _DIR_MESSAGE,_DIR_MMX,
_DIR_NOTE, _DIR_NOTE,
@ -45,10 +46,12 @@ const
lastdirective=_DIR_WARNING; lastdirective=_DIR_WARNING;
directive:array[tdirectivetoken] of directivestr=( directive:array[tdirectivetoken] of directivestr=(
'', '',
'D','DEFINE', 'ALIGN',
'D','DEFINE','DESCRIPTION',
'ELSE','ENDIF','ERROR', 'ELSE','ENDIF','ERROR',
'FATAL', 'FATAL',
'I','I386_ATT','I386_DIRECT','I386_INTEL','IF','IFDEF','IFNDEF','IFOPT','INFO', 'I','I386_ATT','I386_DIRECT','I386_INTEL','IOCHECKS',
'IF','IFDEF','IFNDEF','IFOPT','INFO',
'L','LINKLIB', 'L','LINKLIB',
'MESSAGE','MMX', 'MESSAGE','MMX',
'NOTE', 'NOTE',
@ -588,9 +591,9 @@ const
begin begin
skipspace; skipspace;
hs:=readcomment; hs:=readcomment;
while (hs<>'') and (hs[length(hs)]=' ') do while (hs<>'') and (hs[length(hs)]=' ') do
dec(byte(hs[0])); dec(byte(hs[0]));
hs:=FixFileName(hs); hs:=FixFileName(hs);
fsplit(hs,path,name,ext); fsplit(hs,path,name,ext);
{ first look in the path of _d then currentmodule } { first look in the path of _d then currentmodule }
path:=search(hs,path+';'+current_module^.current_inputfile^.path^+';'+includesearchpath,found); path:=search(hs,path+';'+current_module^.current_inputfile^.path^+';'+includesearchpath,found);
@ -714,13 +717,31 @@ const
end; end;
procedure dir_delphiswitch(t:tdirectivetoken);
var
sw : char;
begin
case t of
_DIR_ALIGN : sw:='A';
_DIR_IOCHECKS : sw:='I';
else
exit;
end;
{ c contains the next char, a + or - would be fine }
HandleSwitch(sw,c);
ReadComment;
end;
type type
tdirectiveproc=procedure(t:tdirectivetoken); tdirectiveproc=procedure(t:tdirectivetoken);
const const
directiveproc:array[tdirectivetoken] of tdirectiveproc=( directiveproc:array[tdirectivetoken] of tdirectiveproc=(
{_DIR_NONE} nil, {_DIR_NONE} nil,
{_DIR_ALIGN} dir_delphiswitch,
{_DIR_D} dir_description, {_DIR_D} dir_description,
{_DIR_DEFINE} dir_define, {_DIR_DEFINE} dir_define,
{_DIR_DESCRIPTION} dir_description,
{_DIR_ELSE} dir_conditional, {_DIR_ELSE} dir_conditional,
{_DIR_ENDIF} dir_conditional, {_DIR_ENDIF} dir_conditional,
{_DIR_ERROR} dir_message, {_DIR_ERROR} dir_message,
@ -729,6 +750,7 @@ const
{_DIR_I386_ATT} dir_asmmode, {_DIR_I386_ATT} dir_asmmode,
{_DIR_I386_DIRECT} dir_asmmode, {_DIR_I386_DIRECT} dir_asmmode,
{_DIR_I386_INTEL} dir_asmmode, {_DIR_I386_INTEL} dir_asmmode,
{_DIR_IOCHECKS} dir_delphiswitch,
{_DIR_IF} dir_conditional, {_DIR_IF} dir_conditional,
{_DIR_IFDEF} dir_conditional, {_DIR_IFDEF} dir_conditional,
{_DIR_IFNDEF} dir_conditional, {_DIR_IFNDEF} dir_conditional,
@ -801,7 +823,11 @@ const
{ {
$Log$ $Log$
Revision 1.3 1998-04-28 11:45:53 florian Revision 1.4 1998-04-29 13:42:27 peter
+ $IOCHECKS and $ALIGN to test already, other will follow soon
* fixed the wrong linecounting with comments
Revision 1.3 1998/04/28 11:45:53 florian
* make it compilable with TP * make it compilable with TP
+ small COM problems solved to compile classes.pp + small COM problems solved to compile classes.pp

View File

@ -388,7 +388,6 @@ unit scanner;
if compilestatusproc(status) then if compilestatusproc(status) then
stop; stop;
inc(current_module^.current_inputfile^.line_no); inc(current_module^.current_inputfile^.line_no);
{ inc(current_module^.current_inputfile^.line_count);}
inc(abslines); inc(abslines);
lastlinepos:=longint(inputpointer); lastlinepos:=longint(inputpointer);
end; end;
@ -559,10 +558,6 @@ unit scanner;
if found=1 then if found=1 then
found:=2; found:=2;
end; end;
#10,#13 : begin
linebreak;
found:=0;
end;
else else
found:=0; found:=0;
end; end;
@ -571,6 +566,8 @@ unit scanner;
reload reload
else else
inc(longint(inputpointer)); inc(longint(inputpointer));
if c in [#10,#13] then
linebreak;
until (found=2); until (found=2);
end; end;
@ -589,7 +586,6 @@ unit scanner;
case c of case c of
'{' : inc_comment_level; '{' : inc_comment_level;
'}' : dec_comment_level; '}' : dec_comment_level;
#10,#13 : linebreak;
#26 : Message(scan_f_end_of_file); #26 : Message(scan_f_end_of_file);
end; end;
c:=inputpointer^; c:=inputpointer^;
@ -597,6 +593,8 @@ unit scanner;
reload reload
else else
inc(longint(inputpointer)); inc(longint(inputpointer));
if c in [#10,#13] then
linebreak;
end; end;
end; end;
@ -650,10 +648,6 @@ unit scanner;
end; end;
end; end;
'(' : found:=3; '(' : found:=3;
#10,#13 : begin
linebreak;
found:=0;
end;
else else
found:=0; found:=0;
end; end;
@ -662,6 +656,8 @@ unit scanner;
reload reload
else else
inc(longint(inputpointer)); inc(longint(inputpointer));
if c in [#10,#13] then
linebreak;
until (found=2); until (found=2);
end; end;
end; end;
@ -1302,20 +1298,17 @@ unit scanner;
begin begin
if lastasmgetchar<>#0 then if lastasmgetchar<>#0 then
begin begin
asmgetchar:=lastasmgetchar; c:=lastasmgetchar;
lastasmgetchar:=#0; lastasmgetchar:=#0;
exit; end
end; else
readchar; readchar;
case c of case c of
#10,#13 : begin
linebreak;
asmgetchar:=c;
end;
'{' : begin '{' : begin
skipcomment; skipcomment;
asmgetchar:=';';
lastasmgetchar:=c; lastasmgetchar:=c;
asmgetchar:=';';
exit;
end; end;
'/' : begin '/' : begin
readchar; readchar;
@ -1392,7 +1385,11 @@ unit scanner;
end. end.
{ {
$Log$ $Log$
Revision 1.12 1998-04-29 10:34:04 pierre Revision 1.13 1998-04-29 13:42:27 peter
+ $IOCHECKS and $ALIGN to test already, other will follow soon
* fixed the wrong linecounting with comments
Revision 1.12 1998/04/29 10:34:04 pierre
+ added some code for ansistring (not complete nor working yet) + added some code for ansistring (not complete nor working yet)
* corrected operator overloading * corrected operator overloading
* corrected nasm output * corrected nasm output