yasl
yasl copied to clipboard
`str.repr` and related functions
these should return a string representation that is legal YASL code.
for example:
const x = 'string'
echo x # string
echo x->repr() # 'string'
Strings will be quoted, certain characters will be escaped, etc.
list.repr
and table.repr
will behave recursively.
Possibly, we need a set.repr
as well.
For many types, these could defer to type.tostr
, for example booleans and ints.
Added a parameter to tostr
in v0.13.0