changeset 420:e9d4d5854e54

add String.encode
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 01 May 2015 14:23:17 -0600
parents 8fbb961aabd5
children b31d614343e8
files core/src/luan/Luan.java core/src/luan/modules/String.luan core/src/luan/modules/StringLuan.java
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/core/src/luan/Luan.java	Thu Apr 30 23:15:40 2015 -0600
+++ b/core/src/luan/Luan.java	Fri May 01 14:23:17 2015 -0600
@@ -132,6 +132,7 @@
 		s = s.replace("\t","\\t");
 		s = s.replace("\u000b","\\v");
 		s = s.replace("\"","\\\"");
+		s = s.replace("\'","\\'");
 		return s;
 	}
 
--- a/core/src/luan/modules/String.luan	Thu Apr 30 23:15:40 2015 -0600
+++ b/core/src/luan/modules/String.luan	Fri May 01 14:23:17 2015 -0600
@@ -4,6 +4,7 @@
 unicode = StringLuan.unicode
 char = StringLuan.char_
 concat = StringLuan.concat
+encode = StringLuan.encode
 find = StringLuan.find
 format = StringLuan.format
 gmatch = StringLuan.gmatch
--- a/core/src/luan/modules/StringLuan.java	Thu Apr 30 23:15:40 2015 -0600
+++ b/core/src/luan/modules/StringLuan.java	Fri May 01 14:23:17 2015 -0600
@@ -235,4 +235,8 @@
 		return sb.toString();
 	}
 
+	public static String encode(String s) {
+		return Luan.stringEncode(s);
+	}
+
 }