diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..8e2d16bd3 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/source/global/constants.bas b/source/global/constants.bas index 6d2d54dcb..24eeb2e9a 100644 --- a/source/global/constants.bas +++ b/source/global/constants.bas @@ -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 diff --git a/source/qb64pe.bas b/source/qb64pe.bas index c812cbfd5..a57d0bedc 100644 --- a/source/qb64pe.bas +++ b/source/qb64pe.bas @@ -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 diff --git a/source/utilities/statevars.bas b/source/utilities/statevars.bas index 287bb89af..03e27b29b 100644 --- a/source/utilities/statevars.bas +++ b/source/utilities/statevars.bas @@ -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 diff --git a/tests/compile_tests/auto_include/color0.bas b/tests/compile_tests/auto_include/color0.bas index 37e7307e3..a971b95b9 100644 --- a/tests/compile_tests/auto_include/color0.bas +++ b/tests/compile_tests/auto_include/color0.bas @@ -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 diff --git a/tests/compile_tests/auto_include/color32.bas b/tests/compile_tests/auto_include/color32.bas index 64e776b7d..b760d8d83 100644 --- a/tests/compile_tests/auto_include/color32.bas +++ b/tests/compile_tests/auto_include/color32.bas @@ -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