Documentation
¶
Overview ¶
Package mappings some go built in functions to grol functions. Same mechanism can be used to map other go functions to grol functions and further extend the language.
Index ¶
- Constants
- func DropStartingShebang(what string) string
- func HSLToRGB(h, s, l float64) color.NRGBA
- func Init(c *Config) error
- func MapToStruct[T any](inp object.Map, out *T) error
- func MustCreate(ext object.Extension)
- func TryParseTime(input string) (time.Time, error)
- type Config
- type FontCache
- type GrolImage
- type ImageMap
- type OneFloatInOutFunc
Constants ¶
View Source
const DefaultTrimSet = " \r\n\t"
View Source
const GrolFileExtension = ".gr" // Also the default filename for LoadSaveEmptyOnly.
View Source
const MaxImageDimension = 1024 // in pixels.
TODO: make this configurable and use the slice check as well as some sort of LRU.
Variables ¶
This section is empty.
Functions ¶
func DropStartingShebang ¶ added in v0.84.0
func Init ¶
Init initializes the extensions, can be called multiple time safely but should really be called only once before using GROL repl/eval. If the passed Config pointer is nil, default (safe) values are used.
func MapToStruct ¶ added in v0.86.0
Convert a grol map to a go struct (via json).
func MustCreate ¶ added in v0.63.0
Types ¶
type Config ¶ added in v0.41.0
type Config struct {
HasLoad bool // load() only present if this is true.
HasSave bool // save() only present if this is true.
LoadSaveEmptyOnly bool // Restrict load/save to a single .gr file inside the current directory.
UnrestrictedIOs bool // Dangerous when true: can overwrite files, read any readable file etc...
}
Configure restrictions and features. Currently about IOs of load and save functions.
type FontCache ¶ added in v0.85.0
type FontCache struct {
// contains filtered or unexported fields
}
FontCache stores parsed fonts and font faces.
type GrolImage ¶ added in v0.68.0
type GrolImage struct {
Image *image.RGBA
Vect *vector.Rasterizer
W, H int
}
type OneFloatInOutFunc ¶
Click to show internal directories.
Click to hide internal directories.