flp-tsl

Crates.ioflp-tsl
lib.rsflp-tsl
version0.1.4
sourcesrc
created_at2022-08-30 00:48:04.50653
updated_at2023-03-19 17:36:07.523231
descriptionTemplate Script Language
homepagehttps://flp-tsl.rs/
repositoryhttps://github.com/Hakukano/FLP-TSL
max_upload_size
id654859
size22,580
(Hakukano)

documentation

https://docs.rs/flp-tsl

README

FLP-TSL

Crates.io Version

Template scripting language for rust game development

Supported version

The first line of a tsl file should be a version notation. E.g. @ 0.1

Check src/parser.rs for the supported range.

Template Variables

Just put ${variable} in anywhere of the script content and it will be replace by actual value of variable.

To escape the ${...}, use \${...} instead.

Grammar

For each line:

Operator Space Content

Operators

  • / -- Comments. Will be ignored during parsing.
  • ! -- Initialization. Contains a full JSON object or a part of JSON object. Will be combined with all adjacent initialization opeartors.
  • < -- Modification. Modifies current stage. Should be a valid JS assignment. (Index style only). e.g. obj[0]["name"] = "abc".
  • > -- Output. The text to be output to the screen.
  • * -- Delay. Delay the script for n milliseconds.
  • # -- Eol. Indicates the end of line.

Examples

See sample folder.

Commit count: 25

cargo fmt