In file parser.bmx within method TParser.ParseMain():
Existing Code in 0.143
'Parse header - imports etc.
While _toke
SetErr
Select _toke.ToLower()
...
Case "moduleinfo"
NextToke
Local info:String = ParseStringLit()
_module.modInfo.AddLast(info)
Default
Exit
End Select
If _tokeType = TOKE_PRAGMA Then
ParsePragmaStmt()
NextToke
End If
Wend
The Default at the end of the select..case, exits before it gets to the PRAGMA parser. I fixed it by moving the pragma parser into the default like this:
Potential fix
'Parse header - imports etc.
While _toke
SetErr
Select _toke.ToLower()
...
Case "moduleinfo"
NextToke
Local info:String = ParseStringLit()
_module.modInfo.AddLast(info)
Default
If _tokeType = TOKE_PRAGMA Then
ParsePragmaStmt()
NextToke
Else
Exit
End If
End Select
Wend
Bug Report
Consider the following code that includes simple Pragmas: `SuperStrict
' @bmk echo ' @bmk echo * ?Debug ' @bmk echo DEBUG MODE ?Not Debug ' @bmk echo RELEASE MODE ? ' @bmk echo *
Print "Hello World"`
Expected Behavior
In version 0.138 this would print "DEBUG MODE" or "RELEASE MODE" during compilation, but since 0.139 this no longer works.
Actual Behavior
Environment
bcc -v
: I have tried versions 0.136 (working), 0.138 (working/official), 0.139 (broken), 0.140 (broken), 0.142 (broken) and 0.143 (latest/broken)Investigation
In file parser.bmx within method TParser.ParseMain(): Existing Code in 0.143
The Default at the end of the select..case, exits before it gets to the PRAGMA parser. I fixed it by moving the pragma parser into the default like this: Potential fix