Skip to content
 
 

Repository files navigation

tree-sitter-twee

A tree-sitter grammar for the Twee 3 interactive-fiction format, with SugarCube syntax support.

What it parses

  • Passages with headings, tags, and inline/standalone JSON metadata
  • Link syntax: [[label->dest]], [[label<-dest]], [[label|dest]], [img[src]]
  • SugarCube macros: <<name args>>, <</name>>, shortcut <<= expr>> / <<- expr>>
  • Sigil-prefixed variables: $story, _temp, ?template
  • Comments: /* */, /% %/, <!-- -->
  • Inline HTML tags
  • Strings, numbers, and word-operators (to, is, eq, gt, …) tokenized inside macro bodies

About

A Tree Sitter parser for Twee with SugarCube syntax highlighting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages