2022-02-09 23:14:29 +00:00
|
|
|
module Luau.Value.ToString where
|
|
|
|
|
|
|
|
open import Agda.Builtin.String using (String)
|
2022-02-18 19:09:00 +00:00
|
|
|
open import Agda.Builtin.Float using (primShowFloat)
|
2022-02-24 19:17:46 +00:00
|
|
|
open import Agda.Builtin.Bool using (true; false)
|
|
|
|
open import Luau.Value using (Value; nil; addr; number; bool)
|
2022-02-09 23:14:29 +00:00
|
|
|
open import Luau.Addr.ToString using (addrToString)
|
|
|
|
|
|
|
|
valueToString : Value → String
|
|
|
|
valueToString nil = "nil"
|
|
|
|
valueToString (addr a) = addrToString a
|
2022-02-18 19:09:00 +00:00
|
|
|
valueToString (number x) = primShowFloat x
|
2022-02-24 19:17:46 +00:00
|
|
|
valueToString (bool false) = "false"
|
|
|
|
valueToString (bool true) = "true"
|