// chercher le fichier...
File src = SourceFile.findSourceFileName(npath.getString());
// c'est parti!...
String msrc = "";
SourceFile in = null;
if (src != null) {
in = new SourceFile(src.getAbsolutePath());
}
else {
Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_PATH);
if (iPaths != null) {
if (iPaths.getQType()==Node.TYPE_CLIST) {
for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
Node pval = iPaths.elementAt(ip);
if (pval.isString()) {
src = SourceFile.findSourceFileName(pval.getString() + npath.getString());
if (src != null) {
in = new SourceFile(src.getAbsolutePath());
ip = -1;
}
}
}
}
}
}
if (in == null) {
Node iPaths = Heap.getv(ASymbol.SYMBOL_IMPORTS_BASE_URL);
if (iPaths != null) {
if (iPaths.getQType()==Node.TYPE_CLIST) {
for (int ip = (iPaths.size() - 1); ip >= 0; ip--) {
Node pval = iPaths.elementAt(ip);
if (pval.isString()) {
URL surl = SourceFile.findSourceURLName(pval.getString() + npath.getString());
if (surl != null) {
in = new SourceFile(surl);
ip = -1;
}
}
}
}
}
}
if (in != null) {
try {
in.load();
msrc = in.getSource();
Interpreter interpreter = Interpreter.interpr_getNewChildInterpreter();
//Register continue dans le même thread...
Heap.push(); // mais en créant une closure
interpreter.setSource(msrc);
interpreter.compile();