diff options
| author | Michael Williamson <mike@zwobble.org> | 2025-01-08 19:14:03 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2025-01-09 20:36:42 +0000 |
| commit | 3666a4af2eb35177eecd557d2a75f4bac9da75b9 (patch) | |
| tree | a85230de832bc7f970dd89aaa6bb2da6ea5875f4 /src/main/java/org/shedlang/compiler/ShedCompiler.java | |
| parent | 1e6e1f7bb8776fc013f76828ed8df3f9297d095b (diff) | |
Use source text to implement FileFragmentSource
Diffstat (limited to 'src/main/java/org/shedlang/compiler/ShedCompiler.java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/ShedCompiler.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/shedlang/compiler/ShedCompiler.java b/src/main/java/org/shedlang/compiler/ShedCompiler.java index 0efbe1d5..a57a3386 100644 --- a/src/main/java/org/shedlang/compiler/ShedCompiler.java +++ b/src/main/java/org/shedlang/compiler/ShedCompiler.java @@ -9,11 +9,11 @@ import org.shedlang.compiler.config.ProjectConfig; import org.shedlang.compiler.parser.Parser; import org.shedlang.compiler.shid.ShidCodeGen; import org.shedlang.compiler.shid.ShidNamespace; -import org.shedlang.compiler.sources.Sources; import org.shedlang.compiler.typechecker.TypeChecker; import org.shedlang.compiler.typechecker.TypeCheckerContext; import org.shedlang.compiler.types.*; import org.shedlang.compiler.util.P; +import org.zwobble.sourcetext.SourceText; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -131,9 +131,9 @@ public class ShedCompiler { var namespaceName = new NamespaceName(namespaceNameParts); var sourceContents = Files.readString(sourceFilePath, StandardCharsets.UTF_8); - var source = Sources.file(sourceFilePath, sourceContents); + var sourceText = SourceText.fromString(sourceFilePath.toString(), sourceContents); - var tokens = tokenise(source); + var tokens = tokenise(sourceText); var untypedNode = Parser.parseNamespace(tokens, namespaceName); untypedNamespaceNodes.add(untypedNode); |
