Scoop API

scoop:scoop.core:0.1.0

src/compiler/files.scoop

Selected production source · src/compiler/files.scoop

1package scoop.compiler
3import String
4import Array
5import Byte
7/**
8 * Embeds the exact UTF-8 contents of a file inside the defining Cone.
9 * The constant path is relative to this call's source directory. Both the
10 * path and its resolved symlink target must stay inside the Cone directory.
11 * Invalid UTF-8 is a compile error; BOM and line endings are preserved.
12 * The file is read at compile time. This intrinsic has no function reference.
13 */
14@Intrinsic("include_str")
15public fun includeStr(path: String): String
17/**
18 * Embeds the exact bytes of a file as an immutable Array<Byte>.
19 * The constant path is relative to this call's source directory. Both the
20 * path and its resolved symlink target must stay inside the Cone directory.
21 * The file is read at compile time. This intrinsic has no function reference.
22 */
23@Intrinsic("include_bytes")
24public fun includeBytes(path: String): Array<Byte>