package org.karaffe.compiler.util;

import java.util.Objects;

public class KaraffeSource implements CharSequence {

    private final String source;

    private KaraffeSource(String source) {
        this.source = Objects.requireNonNull(source);
    }

    public static KaraffeSource fromString(String source) {
        return new KaraffeSource(source);
    }

    @Override
    public int length() {
        return this.source.length();
    }

    @Override
    public char charAt(int index) {
        return this.source.charAt(index);
    }

    @Override
    public CharSequence subSequence(int start, int end) {
        return this.subSequence(start, end);
    }

    @Override
    public String toString() {
        return this.source;
    }

    public boolean hasFilePath() {
        return false;
    }
}

@@ -29,16 +29,122 @@
 .util;%0A%0A
+import java.io.IOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.util.List;%0A
 import j
@@ -363,102 +363,464 @@
    p
-ublic static KaraffeSource fromString(String source) %7B%0A        return new KaraffeSource(source
+rivate KaraffeSource(Path path) throws IOException %7B%0A        Objects.requireNonNull(path);%0A        List%3CString%3E strings = Files.readAllLines(path);%0A        this.source = strings.stream().reduce((l, r) -%3E l + %22%5Cn%22 + r).orElse(%22%22);%0A    %7D%0A%0A    public static KaraffeSource fromString(String source) %7B%0A        return new KaraffeSource(source);%0A    %7D%0A%0A    public static KaraffeSource fromPath(Path path) throws IOException %7B%0A        return new KaraffeSource(path
 );%0A 

Add KaraffeSource::fromPath