diff --git a/resources/rapydscript/compiler.js.xz b/resources/rapydscript/compiler.js.xz index 4792b7a8a8..224e587293 100644 Binary files a/resources/rapydscript/compiler.js.xz and b/resources/rapydscript/compiler.js.xz differ diff --git a/resources/rapydscript/lib/pythonize.pyj b/resources/rapydscript/lib/pythonize.pyj new file mode 100644 index 0000000000..a6288d048b --- /dev/null +++ b/resources/rapydscript/lib/pythonize.pyj @@ -0,0 +1,20 @@ +# vim:fileencoding=utf-8 +# License: BSD Copyright: 2016, Kovid Goyal +# globals: _$rapyd$_str + +def strings(): + string_funcs = set(( + 'capitalize strip lstrip rstrip islower isupper isspace lower upper swapcase' + ' center count endswith startswith find rfind index rindex format join ljust rjust' + ' partition rpartition replace split rsplit splitlines zfill').split(' ')) + + if not arguments.length: + exclude = {'split', 'replace'} + elif arguments[0]: + exclude = Array.prototype.slice.call(arguments) + else: + exclude = None + if exclude: + string_funcs = string_funcs.difference(set(exclude)) + for name in string_funcs: + String.prototype[name] = _$rapyd$_str.prototype[name]