newer version
This commit is contained in:
parent
caf99ea472
commit
7a9d436a56
|
@ -29,6 +29,9 @@ struct token dot, aside;
|
|||
struct type *toktype;
|
||||
struct string string;
|
||||
int idfsize = IDFSIZE;
|
||||
#ifdef DEBUG
|
||||
extern int cntlines;
|
||||
#endif
|
||||
|
||||
static
|
||||
SkipComment()
|
||||
|
@ -43,6 +46,9 @@ SkipComment()
|
|||
for (;;) {
|
||||
if (class(ch) == STNL) {
|
||||
LineNumber++;
|
||||
#ifdef DEBUG
|
||||
cntlines++;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
if (ch == '(') {
|
||||
|
@ -79,6 +85,9 @@ GetString(upto)
|
|||
if (class(ch) == STNL) {
|
||||
lexerror("newline in string");
|
||||
LineNumber++;
|
||||
#ifdef DEBUG
|
||||
cntlines++;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
if (ch == EOI) {
|
||||
|
@ -129,6 +138,9 @@ again:
|
|||
|
||||
case STNL:
|
||||
LineNumber++;
|
||||
#ifdef DEBUG
|
||||
cntlines++;
|
||||
#endif
|
||||
tk->tk_lineno++;
|
||||
goto again;
|
||||
|
||||
|
|
|
@ -97,20 +97,17 @@ Compile(src, dst)
|
|||
CompUnit();
|
||||
C_ms_src((arith) (LineNumber - 1), FileName);
|
||||
close_scope(SC_REVERSE);
|
||||
if (err_occurred) {
|
||||
C_close();
|
||||
return 0;
|
||||
}
|
||||
WalkModule(Defined);
|
||||
if (fp_used) {
|
||||
C_ms_flt();
|
||||
if (!err_occurred) {
|
||||
WalkModule(Defined);
|
||||
if (fp_used) {
|
||||
C_ms_flt();
|
||||
}
|
||||
}
|
||||
C_close();
|
||||
#ifdef DEBUG
|
||||
if (options['m']) MemUse();
|
||||
if (options['i']) Info();
|
||||
#endif
|
||||
if (err_occurred) return 0;
|
||||
return 1;
|
||||
return ! err_occurred;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -219,7 +216,10 @@ END SYSTEM.\n";
|
|||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
MemUse()
|
||||
|
||||
int cntlines;
|
||||
|
||||
Info()
|
||||
{
|
||||
extern int cnt_def, cnt_node, cnt_paramlist, cnt_type,
|
||||
cnt_switch_hdr, cnt_case_entry,
|
||||
|
@ -231,5 +231,6 @@ MemUse()
|
|||
cnt_def, cnt_node, cnt_paramlist, cnt_type,
|
||||
cnt_switch_hdr, cnt_case_entry,
|
||||
cnt_scope, cnt_scopelist, cnt_forwards, cnt_tmpvar);
|
||||
print("\nNumber of lines read: %d\n", cntlines);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue