Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,29 @@ public static void main(String[] args) {
// In eclipse only needed this:"../liquidjava-example/src/main/java/"
// In VSCode needs:
// "../liquidjava/liquidjava-umbrella/liquidjava-example/src/main/java/liquidjava/test/project";
String file = args.length == 0 ? allPath : args[0];
ErrorEmitter ee = launch(file);
String path = args.length == 0 ? allPath : args[0];
ErrorEmitter ee = launch(path);
System.out.println(ee.foundError() ? (ee.getFullMessage()) : ("Correct! Passed Verification."));
}

public static ErrorEmitter launchTest(String file) {
ErrorEmitter ee = launch(file);
public static ErrorEmitter launchTest(String path) {
ErrorEmitter ee = launch(path);
return ee;
}

public static ErrorEmitter launch(String file) {
System.out.println("Running LiquidJava on: " + file);
public static ErrorEmitter launch(String path) {
System.out.println("Running LiquidJava on: " + path);
ErrorEmitter ee = new ErrorEmitter();

// check if the path exists
File f = new File(path);
if (!f.exists()) {
ee.addError("Path not found", "The path " + path + " does not exist", 1);
return ee;
}

Launcher launcher = new Launcher();
launcher.addInputResource(file);
launcher.addInputResource(path);
launcher.getEnvironment().setNoClasspath(true);

// Get the current classpath from the system
Expand All @@ -48,7 +57,6 @@ public static ErrorEmitter launch(String file) {
final Factory factory = launcher.getFactory();
final ProcessingManager processingManager = new QueueProcessingManager(factory);

ErrorEmitter ee = new ErrorEmitter();
final RefinementProcessor processor = new RefinementProcessor(factory, ee);
processingManager.addProcessor(processor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void addError(String titleMessage, String msg, int errorStatus) {
}

public boolean foundError() {
return fullMessage != null && position != null;
return fullMessage != null;
}

public String getTitleMessage() {
Expand Down