The _FILE_ word returns nil when the source is a string or the console.

This commit is contained in:
Peter Camilleri 2016-03-30 12:57:22 -04:00
parent 44e85a3499
commit afe32e4631
3 changed files with 9 additions and 3 deletions

View file

@ -181,7 +181,7 @@ class CompileLibraryTester < Minitest::Test
end end
def test_for_FILE_method def test_for_FILE_method
foorth_equal('_FILE_', ['A string.']) foorth_equal('_FILE_', [nil])
nm = File.absolute_path('integration/_FILE_test.foorth') nm = File.absolute_path('integration/_FILE_test.foorth')
foorth_equal('"integration/_FILE_test.foorth" .load ', [nm, 7, nm]) foorth_equal('"integration/_FILE_test.foorth" .load ', [nm, 7, nm])

View file

@ -64,7 +64,10 @@ module XfOOrth
"The console." "The console."
end end
alias :file_name :source_name #The console has no file name to return.
def fine_name
nil
end
end end
end end

View file

@ -21,7 +21,10 @@ module XfOOrth
"A string." "A string."
end end
alias :file_name :source_name #A string source has no file name to return.
def file_name
nil
end
end end