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