1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00

Add _INCLERRORFILE$, which reports the included file that last errored.

Also:
Change qb64.bas to produce C code that reports INCLUDE file names.
This commit is contained in:
FellippeHeitor 2016-07-08 22:48:00 -03:00
parent 766ded514b
commit 90923af3db
3 changed files with 26 additions and 1 deletions

View file

@ -3,5 +3,5 @@ DIM SHARED BuildNum AS STRING
Version$ = "1.000"
'BuildNum format is YYYYMMDD/id, where id is a ever-increasing
'integer. If you make a change, update the date and increase the id!
BuildNum$ = "20160702/32"
BuildNum$ = "20160708/33"

View file

@ -3256,6 +3256,9 @@ DO
inclinenump$ = ""
IF inclinenumber(inclevel) THEN
inclinenump$ = "," + str2$(inclinenumber(inclevel))
thisincname$ = getfilepath$(incname$(inclevel))
thisincname$ = MID$(incname$(inclevel), LEN(thisincname$) + 1)
inclinenump$ = inclinenump$ + "," + CHR$(34) + thisincname$ + CHR$(34)
END IF
IF NoChecks = 0 THEN
PRINT #12, "if(qbevent){evnt(" + str2$(linenumber) + inclinenump$ + ");r=0;}"
@ -3311,6 +3314,9 @@ DO
inclinenump$ = ""
IF inclinenumber(inclevel) THEN
inclinenump$ = "," + str2$(inclinenumber(inclevel))
thisincname$ = getfilepath$(incname$(inclevel))
thisincname$ = MID$(incname$(inclevel), LEN(thisincname$) + 1)
inclinenump$ = inclinenump$ + "," + CHR$(34) + thisincname$ + CHR$(34)
END IF
IF NoChecks = 0 THEN
PRINT #12, "if(qbevent){evnt(" + str2$(linenumber) + inclinenump$ + ");r=0;}"
@ -8119,6 +8125,9 @@ DO
inclinenump$ = ""
IF inclinenumber(inclevel) THEN
inclinenump$ = "," + str2$(inclinenumber(inclevel))
thisincname$ = getfilepath$(incname$(inclevel))
thisincname$ = MID$(incname$(inclevel), LEN(thisincname$) + 1)
inclinenump$ = inclinenump$ + "," + CHR$(34) + thisincname$ + CHR$(34)
END IF
PRINT #12, "if(qbevent){evnt(" + str2$(linenumber) + inclinenump$ + ");}" 'non-resumable error check (cannot exit without handling errors)
PRINT #12, "exit_code=" + e$ + ";"
@ -8139,6 +8148,9 @@ DO
inclinenump$ = ""
IF inclinenumber(inclevel) THEN
inclinenump$ = "," + str2$(inclinenumber(inclevel))
thisincname$ = getfilepath$(incname$(inclevel))
thisincname$ = MID$(incname$(inclevel), LEN(thisincname$) + 1)
inclinenump$ = inclinenump$ + "," + CHR$(34) + thisincname$ + CHR$(34)
END IF
PRINT #12, "if(qbevent){evnt(" + str2$(linenumber) + inclinenump$ + ");}" 'non-resumable error check (cannot exit without handling errors)
PRINT #12, "exit_code=" + e$ + ";"
@ -10367,6 +10379,9 @@ DO
inclinenump$ = ""
IF inclinenumber(inclevel) THEN
inclinenump$ = "," + str2$(inclinenumber(inclevel))
thisincname$ = getfilepath$(incname$(inclevel))
thisincname$ = MID$(incname$(inclevel), LEN(thisincname$) + 1)
inclinenump$ = inclinenump$ + "," + CHR$(34) + thisincname$ + CHR$(34)
END IF
IF NoChecks = 0 THEN
IF dynscope THEN

View file

@ -2856,3 +2856,13 @@ id.args = 1
id.arg = MKL$(STRINGTYPE - ISPOINTER)
id.ret = STRINGTYPE - ISPOINTER
regid
'Return the name of the included file in which the last error occurred
clearid
id.n = "_INCLERRORFILE"
id.musthave = "$"
id.subfunc = 1
id.callname = "func__inclerrorfile"
id.ret = STRINGTYPE - ISPOINTER
regid