Skip to content

Torus Scripting Language: Definitions

roberpot edited this page Aug 22, 2022 · 1 revision

Definitions

TSL source code is divided in modules. Each module is a single file, that is divided in blocks (like sphere). We name this blocks "contexts". We have the following contexts:

  • Resources
  • Defname
  • Dialog
  • ButtonEvents
  • Function
  • Typedefs
  • Book
  • New contexts are coming...
  • EOF

Each context has different rules (and keywords, you can see this in Keywords).

Resources context

This context is a list of modules Torus need to load and compile. You can divide your source code on different directories and each directory can has a Resources context including the modules of this directory.

More info in Resources context

Defname context

This context acts like a namespace where a set of const globals are defined. A defname can depend on other defnames.

More info in Defname context

Dialog context

This context defines the View layer of a dialog (an interactable window).

More info in Dialog context

ButtonEvents context

This context defines the Controller layer of a dialog.

More info in ButtonEvents context

Function context

This context defines a specific user defined procedure or function.

More info in Function context

Typedefs context

Its a list of types.

More info in Typedefs context

Book context

This context defines a Book.

More info in Book context

EOF context

This context is always empty. Needs to be placed at the end of each module.

xx

Clone this wiki locally