Переглянути джерело

Fixes bug where wrong line would be reported

Fixes bug where wrong line would be reported for Include & IncBin.
Thareh 1 рік тому
батько
коміт
1991d89eb6
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      parser.bmx

+ 4 - 2
parser.bmx

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