thp/src/syntax/grammar.md
2023-09-17 17:58:56 -05:00

455 B

Grammar

Module

A module is (commonly) a single source file.

module = top level declaration*

Top level declaration

top level declaration = function declaration

Function declaration

function declaration = "fun", identifier, params list, return type?, block

Params list

params list = "(", ")"

Return type

return type = ;

Block

block = "{", "}"