plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


bd217f8Peter John 2026-07-19T17:27:40+05:30
fix: correct node names and indentation annotations in format.scm
tooling/tree-sitter-plum/queries/plum/format.scm CHANGED
@@ -28,7 +28,6 @@
28
28
  "/"
29
29
  "%"
30
30
  "^"
31
- "|"
32
31
  "&"
33
32
  "<<"
34
33
  ">>"
@@ -69,8 +68,8 @@
69
68
  ; Enum variant separators — new line before each |
70
69
  ; ============================================================
71
70
 
72
- (enum_variant
71
+ (enum
73
- "|" @prepend_hardline)
72
+ (field) @prepend_hardline)
74
73
 
75
74
  ; ============================================================
76
75
  ; Function body — each statement on its own line
@@ -80,11 +79,17 @@
80
79
  (_) @prepend_hardline)
81
80
 
82
81
  ; ============================================================
83
- ; Indent / dedent tokens strip them (Topiary regenerates indentation)
82
+ ; Indentationbody blocks
84
83
  ; ============================================================
85
84
 
85
+ ; Start indent after the = that opens a body in fn/class/trait/enum
86
+ (fn "=" @append_hardline @append_indent_start)
87
+ (class "=" @append_hardline @append_indent_start)
88
+ (trait "=" @append_hardline @append_indent_start)
89
+ (if "=" @append_hardline @append_indent_start)
90
+ (for "=" @append_hardline @append_indent_start)
91
+ (while "=" @append_hardline @append_indent_start)
92
+ (match "=" @append_hardline @append_indent_start)
93
+
94
+ ; End indent after each body node
86
- (indent) @delete
95
+ (body) @append_indent_end
87
-
88
- (dedent) @delete
89
-
90
- (newline) @delete