File tree 1 file changed +5
-3
lines changed
ownlang-parser/src/main/java/com/annimon/ownlang/parser/ast
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 8
8
import com .annimon .ownlang .stages .*;
9
9
import com .annimon .ownlang .util .Range ;
10
10
import com .annimon .ownlang .util .SourceLocation ;
11
- import com .annimon .ownlang .util .input .InputSourceFile ;
11
+ import com .annimon .ownlang .util .input .InputSourceDetector ;
12
12
import com .annimon .ownlang .util .input .SourceLoaderStage ;
13
13
14
14
/**
18
18
public final class IncludeStatement extends InterruptableNode implements Statement , SourceLocation {
19
19
20
20
public final Node expression ;
21
+ private final InputSourceDetector inputSourceDetector ;
21
22
private Range range ;
22
-
23
+
23
24
public IncludeStatement (Node expression ) {
24
25
this .expression = expression ;
26
+ inputSourceDetector = new InputSourceDetector ();
25
27
}
26
28
27
29
public void setRange (Range range ) {
@@ -46,7 +48,7 @@ public Value eval() {
46
48
// TODO LinterStage based on main context
47
49
.then (new FunctionAddingStage ())
48
50
.then (new ExecutionStage ())
49
- .perform (stagesData , new InputSourceFile (path ));
51
+ .perform (stagesData , inputSourceDetector . toInputSource (path ));
50
52
} catch (OwnLangParserException ex ) {
51
53
final var error = new ParseErrorsFormatterStage ()
52
54
.perform (stagesData , ex .getParseErrors ());
You can’t perform that action at this time.
0 commit comments