Add enumeration support and a string splicing test case

Signed-off-by: Janos Laube <janos.dev@gmail.com>
fix memleak

Signed-off-by: Janos Laube <janos.dev@gmail.com>