Bläddra i källkod

Merge pull request #652 from thareh/master

Fixes a couple of issues
Brucey 1 år sedan
förälder
incheckning
5286cc6670
2 ändrade filer med 6 tillägg och 3 borttagningar
  1. 1 0
      ctranslator.bmx
  2. 5 3
      parser.bmx

+ 1 - 0
ctranslator.bmx

@@ -6803,6 +6803,7 @@ End If
 		If opt_debug Then
 		If opt_debug Then
 			For Local Hash:String = EachIn fileRegister.Keys()
 			For Local Hash:String = EachIn fileRegister.Keys()
 				Local file:String = String(fileRegister.ValueForKey(Hash))
 				Local file:String = String(fileRegister.ValueForKey(Hash))
+				file = file.Replace("\", "\\")
 				Emit "bbRegisterSource(" + Hash + ", ~q" + file + "~q);"
 				Emit "bbRegisterSource(" + Hash + ", ~q" + file + "~q);"
 			Next
 			Next
 		End If
 		End If

+ 5 - 3
parser.bmx

@@ -3816,7 +3816,7 @@ End Rem
 	End Method
 	End Method
 	
 	
 	Method ImportModule( modpath$,attrs:Long )
 	Method ImportModule( modpath$,attrs:Long )
-		SetErr
+'		SetErr
 		
 		
 		modpath = modpath.ToLower()
 		modpath = modpath.ToLower()
 		Local basepath:String = ModulePath(modpath)
 		Local basepath:String = ModulePath(modpath)
@@ -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