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