tengri/dsl
2025-05-03 02:13:22 +03:00
..
proptest-regressions edn -> dsl 2025-03-15 16:49:26 +02:00
src dsl: InputLayerCond; collect macros 2025-05-03 02:13:22 +03:00
Cargo.lock edn -> dsl 2025-03-15 16:49:26 +02:00
Cargo.toml tag global v0.1.1 2025-03-16 23:43:14 +02:00
README.md edn -> dsl 2025-03-15 16:49:26 +02:00
test.edn edn -> dsl 2025-03-15 16:49:26 +02:00

ket

ket is the configuration language of tek. it's based on edn but without all the features.

usage

with tengri_output

this is a tengri_output view layout defined using ket:

(bsp/s (fixed/y 2 :toolbar)
  (fill/x (align/c (bsp/w :pool
    (bsp/s :outputs (bsp/s :inputs (bsp/s :tracks :scenes)))))))

with tengri_input

this is a tengri_input keymap defined using ket:

(@u       undo 1)
(@shift-u redo 1)
(@e       editor show :pool-clip)
(@ctrl-a  scene add)
(@ctrl-t  track add)
(@tab     pool toggle)

tokens

ket has 4 "types", represented by variants of the Value enum:

  • Num - numeric literal
  • Sym - textual symbol
  • Key - textual key
  • Exp - parenthesized group of tokens

numeric literal

numbers are passed through as is. only non-negative integers are supported.

0
123456

keys

keys are the names of available operations. they look like this:

simple-key
multi-part/key

keys are implemented by the underlying subsystem:

  • in tengri_output, keys are names of layout primitives
  • in tengri_input, keys are names of commands

symbols

symbols that start with : represent the names of variables provided by the Context trait - such as command parameters, or entire layout components:

:symbol-name

symbols that start with @ represent keybindings. they are parsed in tengri_tui and look like this:

@ctrl-alt-shift-space

parenthesized groups

parenthesized groups represent things like expressions or configuration statements, and look like this:

(some-key :symbol (some/other-key @another-symbol 123) 456)

goals

  • const parse
  • live reload
  • serialize modified code back to original indentation