Skip to content

Commit

Permalink
Dont output line numbers before they were set first
Browse files Browse the repository at this point in the history
The first lines of an xpp preprocessed file contain stuff from include
files; prominently `lib/sysruk.x`. Here, xpp does not issue line
numbers.

This patch prevents rpp from printing (wrong) linenumbers and the
wrong input file.
  • Loading branch information
olebole committed Oct 2, 2017
1 parent 7325b35 commit db81ba6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions unix/boot/spp/rpp/rppfor/ngetch.f
Expand Up @@ -81,6 +81,7 @@ integer function ngetch (c)
linect (level) = n - 1
23006 continue
23004 continue
if (.not.(linect (level) .gt. 0))goto23003
linect (level) = linect (level) + 1
23003 continue
goto 23001
Expand Down
3 changes: 2 additions & 1 deletion unix/boot/spp/rpp/rppfor/outdon.f
Expand Up @@ -67,7 +67,8 @@ subroutine outdon
data sline0(1)/35/,sline0(2)/108/,sline0(3)/105/,sline0(4)/110/,sl
*ine0(5)/101/,sline0(6)/32/,sline0(7)/-2/
if (.not.(dbgout .eq. 1))goto 23000
if (.not.(body .eq. 1 .or. dbglev .ne. level))goto 23002
if (.not.((body .eq. 1 .or. dbglev .ne. level)
* .and. linect (level) .gt. 0))goto 23002
op = 1
ip=1
23004 if (.not.(sline0(ip) .ne. -2))goto 23006
Expand Down
4 changes: 3 additions & 1 deletion unix/boot/spp/rpp/rpprat/ngetch.r
Expand Up @@ -23,7 +23,9 @@
linect (level) = n - 1
}
}
linect (level) = linect (level) + 1
if (linect (level) > 0) {
linect (level) = linect (level) + 1
}
}
else {
c = buf (bp)
Expand Down
2 changes: 1 addition & 1 deletion unix/boot/spp/rpp/rpprat/outdon.r
Expand Up @@ -13,7 +13,7 @@

# If dbgout is enabled output the "#line" statement.
if (dbgout == YES) {
if (body == YES | dbglev != level) {
if ((body == YES | dbglev != level) & linect (level) > 0) {
op = 1
for (ip=1; s_line(ip) != EOS; ip=ip+1) {
obuf(op) = s_line(ip)
Expand Down

0 comments on commit db81ba6

Please sign in to comment.