A Scriggofile is a text file with a specific format used by the
scriggo command. The
scriggo command uses the
instructions in a Scriggofile to create an interpreter or to generate an importer to use in an existing application.
A Scriggofile defines which packages a program or template can import, what exported declarations in a package can be imported and so on.
The format of the Scriggofile is:
# A comment INSTRUCTION arguments
A line starting with
# is a comment, and the instructions are case insensitive but for convention are written in
uppercase (the syntax recalls that used by Dockerfile).
A Scriggofile must be encoded as UTF-8, and it should be named
Scriggofile or with the extension
The instructions are:
IMPORT STANDARD LIBRARY
Makes almost all the packages in the Go standard library importable in a program or template executed by the application.
To view all packages imported execute from a console:
$ scriggo stdlib
Makes the package with path
IMPORT <package> INCLUDING <A> <B> <C>
IMPORT <package> but only the exported names
C are imported.
IMPORT <package> EXCLUDING <A> <B> <C>
IMPORT <package> but the exported names
C are not imported.
IMPORT <package> AS <as>
IMPORT <package> but the path by which it can be imported is named
EXCLUDING can be
used as for the other forms of
IMPORT at the end of the instruction. Is not possible to use a path
as that would
conflict with a Go standard library package path, even if this latter is not imported in the Scriggofile.
SET VARIABLE <name>
Sets the name of the variable to which the value of type
native.Packages is assigned with the packages to import.
By default, the name is
packages. This instruction is read only by the
SET PACKAGE <name>
Sets the name of the package of the generated Go source file. By default, the name of the package is
instruction is read only by the