Repository navigation
v0.54.0
Highlights
Masks by name, on anything that holds cells. Pass a mask first, straight to text, a list, a grid or a 3D list. ->grid() isn't needed first any more:
fn get_tree_count(input: string): number {
return $input->shapes(Tree, rotated)->count()
}
$input->shapes([Block, Ell], rotated) // several masks at once
$input->shapes(Block, square, of: '#') // masks and built-in shapes together
rotated turns a mask every way the input allows: back to front along a row, four quarter turns in a grid, and all 24 orientations in 3D (where points also have a layer).
Masks are just pictures. Every layout character matches a cell holding the same character, so symbols only lists the exceptions, and any marks a cell that isn't part of the shape:
type Tree extends Mask {
layout: ```text
#.#
...
#.#
```
symbols: { '.': any }
}
A blank line in a layout starts the next layer. Hovering a mask's name draws its picture with a legend.
Cleaner suggestions in calls. An argument slot offers only what it can take: no stray variables after a comma, each flag once as its bare word (rotated, never rotated:), and nothing that's already written. Signature help stays open and highlights the parameter you're on, and ->shapes() shows one form at a time.
Breaking changes
like:is removed from->shapes(). Write the mask first:->shapes(like: Tree)becomes->shapes(Tree). The quick fix rewrites the call.nullin a mask's symbols is nowany, with a quick fix.- Mask members are written with
:.layout = ...is an error with a fix. - New mask checks: an empty layout, a layout that's all
any, a tab in the picture, layers of different heights, a symbol longer than one character, and a symbol listed twice are errors. KS6025 warns about a character mapped to itself, and KS6026 fades a symbol the layout doesn't use. Each comes with a fix. of:,size:,radius:anddistance:given beside only masks are errors, with a fix that removes them.
Run kscript update to get this release.
What's Changed
- Masks in a .test.kscript file, kept clean in the editor and kscript check by @kylepantall in #360
- Offer only what an argument slot can take, and keep the signature open by @kylepantall in #361
- Masks by name on any input: $input->shapes(Tree, rotated) by @kylepantall in #362
- Release v0.54.0 by @kylepantall in #363
Full Changelog: v0.53.0...v0.54.0