Tree-sitter grammar for the current Peeper language revision.
This grammar targets the new Peeper syntax in this repo, not the older Peeper compiler syntax.
- imports
- top-level
let/const struct,interface, andenumdeclarationsimpl T { ... }- plain function declarations
- generic type/function syntax with
<T> let/let mutif/elsematch^Tpointer types and?Toptionals- array literals and indexing
- postfix
++/-- - struct literals:
.{ x = 1, y = 2 } - field access and method calls
comptimeparameters and prefix expressions- structural
struct/interface/enumtype expressions !!,??,catch
The grammar is configured for .peep files.
tree-sitter generate
tree-sitter testTo validate the grammar against the compiler sample file:
tree-sitter parse ../PeeperCompiler/x_test/struct_runtime.peep