@@ -197,8 +197,8 @@ public void DefineMacro(string key, string value) {
197197
198198 // NB: Pushes files to a stack, so call in reverse order if you are
199199 // including multiple files.
200- public void IncludeFile ( string includeDir , string file , bool isDMStandard , Location ? includedFrom = null ) {
201- string filePath = Path . Combine ( includeDir , file ) ;
200+ public void IncludeFile ( string ? includeDir , string file , bool isDMStandard , Location ? includedFrom = null ) {
201+ string filePath = Path . Combine ( includeDir ?? string . Empty , file ) ;
202202 filePath = filePath . Replace ( '\\ ' , Path . DirectorySeparatorChar ) ;
203203 filePath = Path . GetFullPath ( filePath ) ; // Strips out path operators
204204
@@ -243,7 +243,7 @@ public void IncludeFile(string includeDir, string file, bool isDMStandard, Locat
243243 }
244244 }
245245
246- public void PreprocessFile ( string includeDir , string file , bool isDMStandard ) {
246+ public void PreprocessFile ( string ? includeDir , string file , bool isDMStandard ) {
247247 file = file . Replace ( '\\ ' , '/' ) ;
248248
249249 _lexerStack . Push ( new DMPreprocessorLexer ( compiler , includeDir , file , isDMStandard ) ) ;
@@ -275,7 +275,7 @@ private void HandleIncludeDirective(Token includeToken) {
275275
276276 DMPreprocessorLexer currentLexer = _lexerStack . Peek ( ) ;
277277 string file = Path . Combine ( Path . GetDirectoryName ( currentLexer . File . Replace ( '\\ ' , Path . DirectorySeparatorChar ) ) , includedFileToken . ValueAsString ( ) ) ;
278- string directory = currentLexer . IncludeDirectory ;
278+ string ? directory = currentLexer . IncludeDirectory ;
279279
280280 IncludeFile ( directory , file , includeToken . Location . InDMStandard , includedFrom : includeToken . Location ) ;
281281 }
@@ -307,7 +307,7 @@ private void HandleDefineDirective(Token defineToken) {
307307 }
308308
309309 DMPreprocessorLexer currentLexer = _lexerStack . Peek ( ) ;
310- string dir = Path . Combine ( currentLexer . IncludeDirectory , dirTokenValue ) ;
310+ string dir = Path . Combine ( currentLexer . IncludeDirectory ?? string . Empty , dirTokenValue ) ;
311311 compiler . AddResourceDirectory ( dir , dirToken . Location ) ;
312312
313313 // In BYOND it goes on to set the FILE_DIR macro's value to the added directory
0 commit comments