2022-02-09 08:26:58 +08:00
|
|
|
module Luau.Syntax where
|
|
|
|
|
2022-02-10 07:14:29 +08:00
|
|
|
open import Luau.Var using (Var)
|
|
|
|
open import Luau.Addr using (Addr)
|
2022-02-09 08:26:58 +08:00
|
|
|
|
|
|
|
infixr 5 _∙_
|
|
|
|
|
|
|
|
data Block : Set
|
|
|
|
data Stat : Set
|
|
|
|
data Expr : Set
|
|
|
|
|
|
|
|
data Block where
|
|
|
|
_∙_ : Stat → Block → Block
|
2022-02-10 07:14:29 +08:00
|
|
|
done : Block
|
2022-02-09 08:26:58 +08:00
|
|
|
|
|
|
|
data Stat where
|
|
|
|
function_⟨_⟩_end : Var → Var → Block → Stat
|
|
|
|
local_←_ : Var → Expr → Stat
|
|
|
|
return : Expr → Stat
|
|
|
|
|
|
|
|
data Expr where
|
|
|
|
nil : Expr
|
|
|
|
var : Var → Expr
|
2022-02-10 07:14:29 +08:00
|
|
|
addr : Addr → Expr
|
2022-02-09 08:26:58 +08:00
|
|
|
_$_ : Expr → Expr → Expr
|
|
|
|
function⟨_⟩_end : Var → Block → Expr
|
2022-02-10 07:14:29 +08:00
|
|
|
block_is_end : Var → Block → Expr
|