Mercurial Hosting > luan
comparison core/src/luan/modules/PickleCon.java @ 430:f28320fd671d
fix LuanTable.toString() to use metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2015 20:35:26 -0600 |
parents | dae264ad6a7b |
children | d9df6d6cb927 |
comparison
equal
deleted
inserted
replaced
429:e3a6d9dbd694 | 430:f28320fd671d |
---|---|
69 | 69 |
70 public String pickle(Object obj) throws LuanException { | 70 public String pickle(Object obj) throws LuanException { |
71 if( obj == null ) | 71 if( obj == null ) |
72 return "nil"; | 72 return "nil"; |
73 if( obj instanceof Boolean ) | 73 if( obj instanceof Boolean ) |
74 return Luan.toString((Boolean)obj); | 74 return obj.toString(); |
75 if( obj instanceof Number ) | 75 if( obj instanceof Number ) |
76 return Luan.toString((Number)obj); | 76 return Luan.toString((Number)obj); |
77 if( obj instanceof String ) | 77 if( obj instanceof String ) |
78 return "\"" + Luan.stringEncode((String)obj) + "\""; | 78 return "\"" + Luan.stringEncode((String)obj) + "\""; |
79 if( obj instanceof LuanTable ) | 79 if( obj instanceof LuanTable ) |