From 2a74651cf75dbb9db5c1b16a70433aee3ed5c01d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 23 Dec 2024 09:25:22 +0000 Subject: Allow construction of file source with Path --- src/main/java/org/shedlang/compiler/sources/Sources.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/org/shedlang/compiler/sources') diff --git a/src/main/java/org/shedlang/compiler/sources/Sources.java b/src/main/java/org/shedlang/compiler/sources/Sources.java index 5fb6a3b0..9a556aff 100644 --- a/src/main/java/org/shedlang/compiler/sources/Sources.java +++ b/src/main/java/org/shedlang/compiler/sources/Sources.java @@ -1,9 +1,15 @@ package org.shedlang.compiler.sources; +import java.nio.file.Path; + public class Sources { public static Source NULL = NullSource.INSTANCE; public static Source RUNTIME = RuntimeSource.INSTANCE; + public static Source file(Path path, String contents) { + return FileFragmentSource.file(path.toString(), contents); + } + public static Source file(String filename, String contents) { return FileFragmentSource.file(filename, contents); } -- cgit v1.2.3