Whitespace and indentation

Syntax and values

Spaces indent blocks. Tabs are not valid Pliro whitespace and produce a diagnostic.

An indented block may use any positive increase in spaces, but a later dedent must return exactly to an earlier indentation width. The formatter standardizes every block level to four spaces.

# language: en
let score = 12

if score >= 10:
    say "High score"
    say score
else:
    say "Keep trying"

Blank lines and comment-only lines do not open, close, or alter a block.

Outside indentation, ASCII form-feed and vertical-tab characters are currently ignored as intra-line separators; they do not contribute indentation width. Other Unicode space characters are not generic Pliro whitespace. Ordinary source should use ASCII spaces and line breaks.

Inside matching parentheses, brackets, or braces, physical newlines and leading indentation are continuation trivia:

# language: en
let colors = [
    "red",
    "green",
    "blue",
]

let player = {
    "name": "Pip",
    "score": 100,
}

drawText(
    320,
    20,
    player.name,
    24,
    "#ffffff",
    "sans",
    "center",
)

Pliro has no semicolon statement separator. Put separate statements on separate logical lines.

Syntax and values · Built-ins · Programming guides