PageRenderTime 33ms CodeModel.GetById 31ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre3/bsh/commands/getSourceFileInfo.bsh

#
Unknown | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | 1d7ce782d92bcdbb0ea83a22c61cd564 MD5 | raw file
 1
 2bsh.help.getSourceFileInfo = "usage: getSourceFileInfo()";
 3
 4import bsh.Interpreter;
 5
 6/**
 7	Return the name of the file or source from which the current interpreter
 8	is reading.  Note that if you use this within a method, the result will
 9	not be the file from which the method was sourced, but will be the file 
10	that the caller of the method is reading.   Methods are sourced once but
11	can be called many times... Each time the interpreter may be associated
12	with a different file and it is that calling interpreter that you are
13	asking for information.
14	<p>
15
16	Note: although it may seems like this command would always return the
17	getSourceFileInfo.bsh file, it does not since it is being executed after
18	sourcing by the caller's interpreter.
19	If one wanted to know the file from which a bsh method was sourced one
20	would have to either capture that info when the file was sourced (by
21	saving the state of the getSourceFileInfo() in a variable outside of
22	the method or more generally we could add the info to the BshMethod class
23	so that bsh methods remember from what source they were created...
24*/
25getSourceFileInfo() {
26	return this.interpreter.getSourceFileInfo();
27}