from

Constructs a SourceFile by reading the contents of a file.

Parameters

source

file to read


fun from(path: String, contents: String): SourceFile

Constructs a SourceFile from a string.

Parameters

path

Description of where the string came from (e.g. file path, "stdin", etc.)

contents

File contents.


fun from(path: String, reader: Reader): SourceFile

Constructs a SourceFile by consuming a reader.

Parameters

path

Description of where reader came from (e.g. file path, "stdin", etc.)

reader

Object to read file contents from