mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-06-29 11:40:38 +00:00
$INCLUDE linking now points to the line number that caused the last error.
This commit is contained in:
parent
caaafda7ec
commit
9481dbcd16
|
@ -167,6 +167,7 @@ DIM SHARED EnteringRGB AS _BYTE
|
||||||
DIM SHARED ActiveINCLUDELink AS LONG
|
DIM SHARED ActiveINCLUDELink AS LONG
|
||||||
DIM SHARED ActiveINCLUDELinkFile AS STRING
|
DIM SHARED ActiveINCLUDELinkFile AS STRING
|
||||||
DIM SHARED HideCurrentLineHighlight AS _BYTE
|
DIM SHARED HideCurrentLineHighlight AS _BYTE
|
||||||
|
DIM SHARED idegotobox_LastLineNum AS LONG
|
||||||
'--------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------
|
||||||
TYPE idedbptype
|
TYPE idedbptype
|
||||||
x AS LONG
|
x AS LONG
|
||||||
|
|
|
@ -500,6 +500,12 @@ FUNCTION ide2 (ignore)
|
||||||
LOOP UNTIL asca = 13
|
LOOP UNTIL asca = 13
|
||||||
lineinput3buffer = ""
|
lineinput3buffer = ""
|
||||||
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
||||||
|
IF ideStartAtLine > 0 AND ideStartAtLine <= iden THEN
|
||||||
|
idecy = ideStartAtLine
|
||||||
|
IF idecy - 10 >= 1 THEN idesy = idecy - 10
|
||||||
|
idegotobox_LastLineNum = ideStartAtLine
|
||||||
|
ideStartAtLine = 0
|
||||||
|
END IF
|
||||||
IdeBmkN = 0
|
IdeBmkN = 0
|
||||||
ideerror = 1
|
ideerror = 1
|
||||||
ideprogname = f$: _TITLE ideprogname + " - QB64"
|
ideprogname = f$: _TITLE ideprogname + " - QB64"
|
||||||
|
@ -2693,7 +2699,11 @@ FUNCTION ide2 (ignore)
|
||||||
PCOPY 3, 0
|
PCOPY 3, 0
|
||||||
|
|
||||||
_DELAY .2
|
_DELAY .2
|
||||||
SHELL QuotedFilename$(COMMAND$(0)) + " " + QuotedFilename$(f$)
|
p$ = QuotedFilename$(COMMAND$(0)) + " " + QuotedFilename$(f$)
|
||||||
|
IF errorLineInInclude > 0 AND idefocusline = idecy THEN
|
||||||
|
p$ = p$ + " -l:" + str2$(errorLineInInclude)
|
||||||
|
END IF
|
||||||
|
SHELL p$
|
||||||
|
|
||||||
IF IDE_AutoPosition THEN
|
IF IDE_AutoPosition THEN
|
||||||
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE"
|
WriteConfigSetting "'[IDE DISPLAY SETTINGS]", "IDE_AutoPosition", "TRUE"
|
||||||
|
@ -10522,8 +10532,6 @@ FUNCTION idemodifycommandbox
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION idegotobox
|
FUNCTION idegotobox
|
||||||
STATIC idegotobox_LastLineNum AS LONG
|
|
||||||
|
|
||||||
'-------- generic dialog box header --------
|
'-------- generic dialog box header --------
|
||||||
PCOPY 0, 2
|
PCOPY 0, 2
|
||||||
PCOPY 0, 1
|
PCOPY 0, 1
|
||||||
|
|
|
@ -338,6 +338,7 @@ DIM SHARED idemessage AS STRING 'set by qb64-error(...) to the error message to
|
||||||
|
|
||||||
DIM SHARED optionexplicit AS _BYTE
|
DIM SHARED optionexplicit AS _BYTE
|
||||||
DIM SHARED optionexplicit_cmd AS _BYTE
|
DIM SHARED optionexplicit_cmd AS _BYTE
|
||||||
|
DIM SHARED ideStartAtLine AS LONG, errorLineInInclude AS LONG
|
||||||
DIM SHARED outputfile_cmd$
|
DIM SHARED outputfile_cmd$
|
||||||
DIM SHARED compilelog$
|
DIM SHARED compilelog$
|
||||||
|
|
||||||
|
@ -1499,6 +1500,7 @@ layout = ""
|
||||||
layoutok = 0
|
layoutok = 0
|
||||||
NoChecks = 0
|
NoChecks = 0
|
||||||
inclevel = 0
|
inclevel = 0
|
||||||
|
errorLineInInclude = 0
|
||||||
addmetainclude$ = ""
|
addmetainclude$ = ""
|
||||||
nextrunlineindex = 1
|
nextrunlineindex = 1
|
||||||
lasttype = 0
|
lasttype = 0
|
||||||
|
@ -2782,6 +2784,7 @@ DO
|
||||||
wholeline$ = x$
|
wholeline$ = x$
|
||||||
inclinenumber(inclevel) = inclinenumber(inclevel) + 1
|
inclinenumber(inclevel) = inclinenumber(inclevel) + 1
|
||||||
'create extended error string 'incerror$'
|
'create extended error string 'incerror$'
|
||||||
|
errorLineInInclude = inclinenumber(inclevel)
|
||||||
e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included"
|
e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included"
|
||||||
IF inclevel > 1 THEN
|
IF inclevel > 1 THEN
|
||||||
e$ = e$ + " (through "
|
e$ = e$ + " (through "
|
||||||
|
@ -10720,6 +10723,7 @@ DO
|
||||||
continuelinefrom = 0
|
continuelinefrom = 0
|
||||||
inclinenumber(inclevel) = inclinenumber(inclevel) + 1
|
inclinenumber(inclevel) = inclinenumber(inclevel) + 1
|
||||||
'create extended error string 'incerror$'
|
'create extended error string 'incerror$'
|
||||||
|
errorLineInInclude = inclinenumber(inclevel)
|
||||||
e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included"
|
e$ = " in line " + str2(inclinenumber(inclevel)) + " of " + incname$(inclevel) + " included"
|
||||||
IF inclevel > 1 THEN
|
IF inclevel > 1 THEN
|
||||||
e$ = e$ + " (through "
|
e$ = e$ + " (through "
|
||||||
|
@ -12663,16 +12667,12 @@ FUNCTION ParseCMDLineArgs$ ()
|
||||||
'in which case they're simply asking for trouble).
|
'in which case they're simply asking for trouble).
|
||||||
FOR i = 1 TO _COMMANDCOUNT
|
FOR i = 1 TO _COMMANDCOUNT
|
||||||
token$ = COMMAND$(i)
|
token$ = COMMAND$(i)
|
||||||
|
IF LCASE$(token$) = "-help" OR LCASE$(token$) = "/help" THEN token$ = "-?"
|
||||||
SELECT CASE LCASE$(LEFT$(token$, 2))
|
SELECT CASE LCASE$(LEFT$(token$, 2))
|
||||||
CASE "/?", "-?", "-h" 'Command-line help
|
CASE "-?", "/?" 'Command-line help
|
||||||
_DEST _CONSOLE
|
_DEST _CONSOLE
|
||||||
PRINT "QB64 COMPILER V" + Version$
|
PRINT "QB64 COMPILER V" + Version$
|
||||||
PRINT
|
PRINT
|
||||||
IF LCASE$(token$) <> "-help" AND LCASE$(token$) <> "-h" AND token$ <> "-?" AND token$ <> "/?" THEN
|
|
||||||
'Ended up being a filename?
|
|
||||||
PassedFileName$ = token$
|
|
||||||
GOTO NextCase
|
|
||||||
END IF
|
|
||||||
PRINT "USAGE: qb64 [switches] <inputs>"
|
PRINT "USAGE: qb64 [switches] <inputs>"
|
||||||
PRINT
|
PRINT
|
||||||
PRINT "OPTIONS:"
|
PRINT "OPTIONS:"
|
||||||
|
@ -12681,42 +12681,41 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
PRINT " -x Compile instead of edit and output the result to the"
|
PRINT " -x Compile instead of edit and output the result to the"
|
||||||
PRINT " console"
|
PRINT " console"
|
||||||
PRINT " -z Generate C code without compiling to executable"
|
PRINT " -z Generate C code without compiling to executable"
|
||||||
'PRINT " -g Non-GUI environment (uses $CONSOLE:ONLY - for G-WAN"
|
|
||||||
'PRINT " compilation)"
|
|
||||||
PRINT " -o <file> Write output executable to <file>"
|
PRINT " -o <file> Write output executable to <file>"
|
||||||
PRINT " -e Enables OPTION _EXPLICIT, making variable declaration"
|
PRINT " -e Enables OPTION _EXPLICIT, making variable declaration"
|
||||||
PRINT " mandatory (per-compilation; doesn't affect the"
|
PRINT " mandatory (per-compilation; doesn't affect the"
|
||||||
PRINT " source file or global settings)"
|
PRINT " source file or global settings)"
|
||||||
PRINT " -s[:switch=true/false] View/edit compiler settings"
|
PRINT " -s[:switch=true/false] View/edit compiler settings"
|
||||||
|
PRINT " -l:<line number> Starts the IDE at the specified line number"
|
||||||
PRINT
|
PRINT
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s" 'Settings
|
CASE "-s", "/s" 'Settings
|
||||||
_DEST _CONSOLE
|
_DEST _CONSOLE
|
||||||
PRINT "QB64 COMPILER V" + Version$
|
PRINT "QB64 COMPILER V" + Version$
|
||||||
SELECT CASE LCASE$(token$)
|
SELECT CASE LCASE$(MID$(token$, 3))
|
||||||
CASE "-s"
|
CASE ""
|
||||||
PRINT "debuginfo = ";
|
PRINT "debuginfo = ";
|
||||||
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
PRINT "exewithsource = ";
|
PRINT "exewithsource = ";
|
||||||
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource"
|
CASE ":exewithsource"
|
||||||
PRINT "exewithsource = ";
|
PRINT "exewithsource = ";
|
||||||
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource=true"
|
CASE ":exewithsource=true"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "TRUE"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "TRUE"
|
||||||
PRINT "exewithsource = TRUE"
|
PRINT "exewithsource = TRUE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource=false"
|
CASE ":exewithsource=false"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "FALSE"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "FALSE"
|
||||||
PRINT "exewithsource = FALSE"
|
PRINT "exewithsource = FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo"
|
CASE ":debuginfo"
|
||||||
PRINT "debuginfo = ";
|
PRINT "debuginfo = ";
|
||||||
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo=true"
|
CASE ":debuginfo=true"
|
||||||
PRINT "debuginfo = TRUE"
|
PRINT "debuginfo = TRUE"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "TRUE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "TRUE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||||
idedebuginfo = 1
|
idedebuginfo = 1
|
||||||
|
@ -12737,7 +12736,7 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
CHDIR "../.."
|
CHDIR "../.."
|
||||||
END IF
|
END IF
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo=false"
|
CASE ":debuginfo=false"
|
||||||
PRINT "debuginfo = FALSE"
|
PRINT "debuginfo = FALSE"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||||
idedebuginfo = 0
|
idedebuginfo = 0
|
||||||
|
@ -12766,27 +12765,24 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
PRINT " -s:exewithsource=true/false (Save .EXE in the source folder)"
|
PRINT " -s:exewithsource=true/false (Save .EXE in the source folder)"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
END SELECT
|
END SELECT
|
||||||
CASE "-q" 'Building a Qloud program
|
CASE "-e", "/e" 'Option Explicit
|
||||||
Cloud = 1
|
|
||||||
ConsoleMode = 1 'Implies -x
|
|
||||||
NoIDEMode = 1 'Imples -c
|
|
||||||
CASE "-e" 'Option Explicit
|
|
||||||
optionexplicit_cmd = -1
|
optionexplicit_cmd = -1
|
||||||
CASE "-z" 'Not compiling C code
|
CASE "-z", "/z" 'Not compiling C code
|
||||||
No_C_Compile_Mode = 1
|
No_C_Compile_Mode = 1
|
||||||
ConsoleMode = 1 'Implies -x
|
ConsoleMode = 1 'Implies -x
|
||||||
NoIDEMode = 1 'Implies -c
|
NoIDEMode = 1 'Implies -c
|
||||||
CASE "-x" 'Use the console
|
CASE "-x", "/x" 'Use the console
|
||||||
ConsoleMode = 1
|
ConsoleMode = 1
|
||||||
NoIDEMode = 1 'Implies -c
|
NoIDEMode = 1 'Implies -c
|
||||||
CASE "-c" 'Compile instead of edit
|
CASE "-c", "/c" 'Compile instead of edit
|
||||||
NoIDEMode = 1
|
NoIDEMode = 1
|
||||||
CASE "-o" 'Specify an output file
|
CASE "-o", "/o" 'Specify an output file
|
||||||
IF LEN(COMMAND$(i + 1)) > 0 THEN outputfile_cmd$ = COMMAND$(i + 1): i = i + 1
|
IF LEN(COMMAND$(i + 1)) > 0 THEN outputfile_cmd$ = COMMAND$(i + 1): i = i + 1
|
||||||
|
CASE "-l", "/l" 'goto line (ide mode only); -l:<line number>
|
||||||
|
IF MID$(token$, 3, 1) = ":" THEN ideStartAtLine = VAL(MID$(token$, 4))
|
||||||
CASE ELSE 'Something we don't recognise, assume it's a filename
|
CASE ELSE 'Something we don't recognise, assume it's a filename
|
||||||
PassedFileName$ = token$
|
IF PassedFileName$ = "" THEN PassedFileName$ = token$
|
||||||
END SELECT
|
END SELECT
|
||||||
NextCase:
|
|
||||||
NEXT i
|
NEXT i
|
||||||
|
|
||||||
IF LEN(PassedFileName$) THEN ParseCMDLineArgs$ = PassedFileName$
|
IF LEN(PassedFileName$) THEN ParseCMDLineArgs$ = PassedFileName$
|
||||||
|
|
Loading…
Reference in a new issue