-
Notifications
You must be signed in to change notification settings - Fork 414
Transcode
Gregg Irwin edited this page Jul 14, 2020
·
4 revisions
Credits: (@toomasv)
Sometimes you can also use the new transcode to check your strings for balanced parens:
>> transcode/trace %{a(b(c)d)e}% func [e i t l o][[open close] print [e mold i]]
open "(b(c)d)e"
open "(c)d)e"
close ")d)e"
close ")e"
== [a (b (c) d) e]
>> transcode/trace %{a(b((c)d)e}% func [e i t l o][[open close] print [e mold i]]
open "(b((c)d)e"
open "((c)d)e"
open "(c)d)e"
close ")d)e"
close ")e"
*** Syntax Error: (line 1) missing ) at (b((c)d)e
*** Where: transcode
*** Stack:
>> transcode/trace %{a(b(c)d))e}% func [e i t l o][[open close] print [e mold i]]
open "(b(c)d))e"
open "(c)d))e"
close ")d))e"
close "))e"
close ")e"
*** Syntax Error: (line 1) missing ( at )e
*** Where: transcode
*** Stack:
Both Red and Red/System are published under the BSD license. The runtime is published under the BSL license.