Browse Source

Fixes bug where wrong line would be reported

Fixes bug where wrong line would be reported for Include & IncBin.
Thareh 1 year ago
parent
commit
1991d89eb6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      parser.bmx

+ 4 - 2
parser.bmx

@@ -4093,15 +4093,17 @@ End Rem
 			Case "function"
 			Case "function"
 				_module.InsertDecl ParseFuncDecl( _toke,attrs )
 				_module.InsertDecl ParseFuncDecl( _toke,attrs )
 			Case "incbin"
 			Case "incbin"
+				SetErr
 				NextToke
 				NextToke
 				Local s:String = ParseStringLit()
 				Local s:String = ParseStringLit()
 				_app.mapStringConsts(s)
 				_app.mapStringConsts(s)
 				Local ib:TIncBin = New TIncbin.Create(s, path)
 				Local ib:TIncBin = New TIncbin.Create(s, path)
 				If Not ib Then
 				If Not ib Then
-					DoErr "Incbin file '"+ s +"' not found."
+					Err "Incbin file '"+ s +"' not found."
 				End If
 				End If
 				_app.incbins.AddLast(ib)
 				_app.incbins.AddLast(ib)
 			Case "include"
 			Case "include"
+				SetErr
 				'include command is NOT just a pattern to replace with
 				'include command is NOT just a pattern to replace with
 				'content. BlitzMax parses each included file before the
 				'content. BlitzMax parses each included file before the
 				'content gets appended to the source (right before
 				'content gets appended to the source (right before
@@ -4118,7 +4120,7 @@ End Rem
 				'of them uses an individual toker
 				'of them uses an individual toker
 
 
 				If FileType( includeFile )<>FILETYPE_FILE
 				If FileType( includeFile )<>FILETYPE_FILE
-					DoErr "File '"+ includeFile +"' not found."
+					Err "File '"+ includeFile +"' not found."
 				EndIf
 				EndIf
 
 
 				'instead of "LoadText" "PreProcess" is used to include
 				'instead of "LoadText" "PreProcess" is used to include