2022-02-22 15:52:56 -08:00
|
|
|
module Luau.RuntimeType where
|
|
|
|
|
2022-03-02 15:26:58 -08:00
|
|
|
open import Luau.Syntax using (Value; nil; addr; number; bool; string)
|
2022-02-22 15:52:56 -08:00
|
|
|
|
|
|
|
data RuntimeType : Set where
|
|
|
|
function : RuntimeType
|
|
|
|
number : RuntimeType
|
|
|
|
nil : RuntimeType
|
2022-02-24 11:17:46 -08:00
|
|
|
boolean : RuntimeType
|
2022-03-02 15:26:58 -08:00
|
|
|
string : RuntimeType
|
2022-02-22 15:52:56 -08:00
|
|
|
|
|
|
|
valueType : Value → RuntimeType
|
|
|
|
valueType nil = nil
|
2022-03-02 16:02:51 -06:00
|
|
|
valueType (addr a) = function
|
|
|
|
valueType (number n) = number
|
|
|
|
valueType (bool b) = boolean
|
2022-03-02 15:26:58 -08:00
|
|
|
valueType (string x) = string
|