Mercurial Hosting > luan
diff src/luan/modules/BasicLuan.java @ 1553:26c51acf00f3
improve stringify
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 06 Oct 2020 19:31:57 -0600 |
parents | 46d4baaad64d |
children | e1a13e707bf3 |
line wrap: on
line diff
--- a/src/luan/modules/BasicLuan.java Sun Oct 04 20:26:49 2020 -0600 +++ b/src/luan/modules/BasicLuan.java Tue Oct 06 19:31:57 2020 -0600 @@ -209,27 +209,8 @@ } } - public static String stringify(Object obj,LuanTable options) throws LuanException { - LuanToString lts = new LuanToString(); - if( options != null ) { - options = new LuanTable(options); - Boolean strict = Utils.removeBoolean(options,"strict"); - if( strict != null ) - lts.strict = strict; - Boolean numberTypes = Utils.removeBoolean(options,"number_types"); - if( numberTypes != null ) - lts.numberTypes = numberTypes; - Boolean compressed = Utils.removeBoolean(options,"compressed"); - if( compressed != null ) - lts.compressed = compressed; - Boolean useLongStrings = Utils.removeBoolean(options,"use_long_strings"); - if( useLongStrings != null ) - lts.useLongStrings = useLongStrings; - LuanTable longStringKeys = Utils.removeTable(options,"long_string_keys"); - if( longStringKeys != null ) - lts.longStringKeys = new HashSet(longStringKeys.asList()); - Utils.checkEmpty(options); - } + public static String stringify(Object obj,LuanTable options,LuanTable subOptions) throws LuanException { + LuanToString lts = new LuanToString(options,subOptions); return lts.toString(obj); }