documentation 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. Any syntax followed by a "?" is optional
  2. commands:
  3. (echo arg0 arg1 .. argN) - prints all arguments to standard output
  4. (int var opt_init) - initialise variable `var`, optionally initialise it with value `opt_init`
  5. (= var value) - assign `value` to `var`
  6. (+ arg0 arg1 .. argN) - add children together
  7. (- arg0 arg1 .. argN) - substract children together
  8. (* arg0 arg1 .. argN) - multiply children together
  9. (/ arg0 arg1 .. argN) - divine children together
  10. (group arg0 arg1 .. argN) - group commands together, useful to pass multiple commands
  11. when another command expects only 1
  12. (def type name value?) - define variable `name`, with given `type`,
  13. optionally inialise it with `value`
  14. (function name arguments commands) - declare function `name`, with arguments `arguments` which calls `commands`
  15. when executed
  16. (class name subclass? components) - declare class `name`, subclass of `subclass`
  17. and includes `components` (variables and functions)
  18. (sprite name texture) - create sprite `name` with texture `texture`
  19. (return arg0) - return `arg0` from a function
  20. (array arg0 arg1 .. argN) - create an array containing all children
  21. (if condition1 statement1 condition2 statement2 .. ( conditionN statementN ) / statementN) -
  22. For every 2 children, if `condition1` is true, then execute `statement1`. Same for condition 2, 3 until N.
  23. If there is an odd number of children, last statement will trigger if no other statement has.