Skip to content

Commit

Permalink
Merge pull request #587 from QB64-Phoenix-Edition/fix-recompile-trigger
Browse files Browse the repository at this point in the history
Fixing compilation process
  • Loading branch information
RhoSigma-QB64 authored Dec 11, 2024
2 parents ce9b165 + 2f34f28 commit b762531
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Auto detect text files and perform LF normalization
* text=auto

# Override GitHub language detection
*.bas linguist-language=qb64
*.bi linguist-language=qb64
*.bm linguist-language=qb64
4 changes: 3 additions & 1 deletion source/global/constants.bas
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ IF Debug THEN sp = CHR$(250): sp2 = CHR$(249): sp3 = CHR$(179) 'makes debug outp
DIM SHARED CHR_QUOTE AS STRING * 1: CHR_QUOTE = _CHR_QUOTE
DIM SHARED CHR_TAB AS STRING * 1: CHR_TAB = _CHR_HT 'horizontal tab
DIM SHARED CRLF AS STRING: CRLF = _STR_CRLF 'carriage return + line feed
DIM SHARED NATIVE_LINEENDING AS STRING: NATIVE_LINEENDING = _STR_NAT_EOL
DIM SHARED NATIVE_LINEENDING AS STRING
IF INSTR(_OS$, "WIN") THEN NATIVE_LINEENDING = _STR_CRLF ELSE NATIVE_LINEENDING = _STR_LF
DIM SHARED OS_BITS AS LONG: OS_BITS = 64
IF INSTR(_OS$, "[32BIT]") THEN OS_BITS = 32
Expand Down
2 changes: 2 additions & 0 deletions source/qb64pe.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1675,11 +1675,13 @@ DO

IF temp$ = "$COLOR:0" THEN
SetRCStateVar ColorSet, 1
IF recompile GOTO do_recompile
GOTO finishedlinepp
END IF

IF temp$ = "$COLOR:32" THEN
SetRCStateVar ColorSet, 2
IF recompile GOTO do_recompile
GOTO finishedlinepp
END IF

Expand Down
2 changes: 1 addition & 1 deletion source/utilities/statevars.bas
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ END SUB
SUB SetRCStateVar (stVar AS RCStateVar, setVal%%)
stVar.wanted = setVal%%
IF stVar.actual <> stVar.wanted AND stVar.locked = _FALSE THEN
recompile = 1 'end of pass recompile trigger
recompile = 1 'recompile trigger
END IF
END SUB

Expand Down
6 changes: 5 additions & 1 deletion tests/compile_tests/auto_include/color0.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
$CONSOLE:ONLY
$COLOR:0

'Let's also try to re-assign a color CONST to a new CONST to prove
'availability of the color constants during pre-pass
CONST newGreen = Green

PRINT "Some $COLOR:0 (color0.bi) constants:"
PRINT "------------------------------------"
PRINT "Red.....:"; Red
PRINT "Green...:"; Green
PRINT "Green...:"; newGreen
PRINT "Blue....:"; Blue

SYSTEM
Expand Down
6 changes: 5 additions & 1 deletion tests/compile_tests/auto_include/color32.bas
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
$CONSOLE:ONLY
$COLOR:32

'Let's also try to re-assign a color CONST to a new CONST to prove
'availability of the color constants during pre-pass
CONST newGreen = Green

PRINT "Some $COLOR:32 (color32.bi) constants:"
PRINT "--------------------------------------"
PRINT "Red.....:"; Red
PRINT "Green...:"; Green
PRINT "Green...:"; newGreen
PRINT "Blue....:"; Blue

SYSTEM
Expand Down

0 comments on commit b762531

Please sign in to comment.