Block Structure
Harneet uses curly braces {} to define blocks of code. These blocks group statements together.
Blocks
- Purpose: Blocks are used to group statements, typically associated with control flow statements (like
if,for,switch) or function definitions. - Syntax: Statements within a block are enclosed in curly braces
{}.
| Block Structure | |
|---|---|
Statement Terminators
Harneet supports both newlines and semicolons as statement terminators. You can use either, or mix them.
- Newline: A new line implicitly terminates a statement.
- Semicolon: A semicolon
;explicitly terminates a statement.
| Statement Termination | |
|---|---|
Indentation
Indentation is not syntactically significant in Harneet (unlike Python), but it is highly recommended for readability and maintaining consistent code style.