@@ -130,21 +130,32 @@ If no file is specified, GGcode will automatically compile **all `.ggcode` files
130130
131131---
132132
133- ## Supported Syntax
134-
135- | Keyword | Description |
136- | -----------| ------------------------------------|
137- | ` let ` | Define variables |
138- | ` if ` | Conditional execution |
139- | ` else if ` | Chained conditional logic |
140- | ` else ` | Fallback execution |
141- | ` while ` | Loop while condition is true |
142- | ` for ` | Range-based loop |
143- | ` note ` | Insert runtime comments |
144- | ` G1 ` , ` M3 ` | G-code statements with parameters |
133+ ## 🧾 Supported Syntax
134+
135+ | Keyword | Description |
136+ | ---------------| -----------------------------------------------------------------------------|
137+ | ` let ` | Define or update variables (` let x = 10 ` ) |
138+ | ` if ` | Execute conditionally based on expression truth |
139+ | ` else if ` | Chain additional conditions to an ` if ` block |
140+ | ` else ` | Execute fallback logic if no prior condition matched |
141+ | ` while ` | Loop while a condition remains true (` while x < 10 { ... } ` ) |
142+ | ` for ` | Loop over a numeric range (` for i = 0..10 { ... } ` ) |
143+ | ` function ` | Define reusable logic blocks with arguments and return values |
144+ | ` return ` | Return a value from within a function |
145+ | ` note {} ` | Runtime log/debug message with variable interpolation (` note {x = [x]} ` ) |
146+ | ` G0 ` , ` G1 ` , ` G2 ` , ` G3 ` , ` M3 ` , etc. | Emit raw G-code motion and control commands |
147+ | ` [ ` ` ] ` | Index into arrays or interpolate expressions in coordinates (` X[x+10] ` ) |
148+ | ` maze[y][x] ` | 2D array access and mutation |
149+ | ` ! ` , ` && ` , `|| ` | Logical NOT, AND, OR expressions |
150+ | ` == ` , ` != ` , ` < ` , ` > ` , ` <= ` , ` >= ` | Comparison operators |
151+ | ` + ` , ` - ` , ` * ` , ` / ` , ` mod ` | Arithmetic and modulo |
152+ | Built-in functions | ` abs() ` , ` sqrt() ` , ` floor() ` , ` hypot() ` , ` distance() ` , ` sin() ` , etc. |
145153
146154---
147155
156+ GGcode supports nesting, recursion, dynamic expressions, scoped variables, and parametric G-code generation.
157+
158+
148159
149160## 📜 License
150161
0 commit comments