2022-02-09 23:14:29 +00:00
|
|
|
module Luau.Value where
|
|
|
|
|
2022-02-24 19:17:46 +00:00
|
|
|
open import Agda.Builtin.Bool using (Bool; true; false)
|
2022-02-18 19:09:00 +00:00
|
|
|
open import Agda.Builtin.Float using (Float)
|
2022-02-09 23:14:29 +00:00
|
|
|
open import Luau.Addr using (Addr)
|
2022-02-24 19:17:46 +00:00
|
|
|
open import Luau.Syntax using (Block; Expr; nil; addr; number; true; false)
|
2022-02-09 23:14:29 +00:00
|
|
|
open import Luau.Var using (Var)
|
|
|
|
|
|
|
|
data Value : Set where
|
|
|
|
nil : Value
|
|
|
|
addr : Addr → Value
|
2022-02-18 19:09:00 +00:00
|
|
|
number : Float → Value
|
2022-02-24 19:17:46 +00:00
|
|
|
bool : Bool → Value
|
2022-02-09 23:14:29 +00:00
|
|
|
|
2022-02-12 01:03:26 +00:00
|
|
|
val : ∀ {a} → Value → Expr a
|
2022-02-09 23:14:29 +00:00
|
|
|
val nil = nil
|
|
|
|
val (addr a) = addr a
|
2022-02-18 19:09:00 +00:00
|
|
|
val (number x) = number x
|
2022-02-24 19:17:46 +00:00
|
|
|
val (bool false) = false
|
|
|
|
val (bool true) = true
|