Commit Graph

14 Commits

Author SHA1 Message Date
janczer
aac1ce4e07 Fix the str.{__lt__, __gt__} and add the methods str.{__le__, __ge__} 2019-02-10 16:40:09 +01:00
ichyo
d1b034e3b9 Avoid using \xhh for string 2019-02-05 23:54:39 +09:00
ichyo
fc779c2e3a Use the number of characters instead of bytes for str.__len__ 2019-02-05 23:26:13 +09:00
ZapAnton
23de5581bd Added tests for the isdecimal method 2019-02-03 02:05:57 +03:00
AgentMacklin
79a3b13252 Implement most of the string methods. (#239)
* implemented more functions

* backup

* Improve demo site

* Formatting; move the `+ '\n'` hack to eval().

* Rename run_code() to run_from_textbox()

* Switch to using json.dumps for py_to_js()

* Clarify names of wasm builtins

* Remove dependency on num_bigint

* Allow injecting JS variables into python with eval_py()

eval_py(`return js_vars["a"]`, { a: 9 }) == 9

* dict() now should work properly

e.g.
``` dict(a=2, b=3) == {"a": 2, "b": 3} ```

* Add documentation for eval_py() and update error message handling

Also, switch from iterating over the values of js_injections and
serializing each of them individually to asserting it's an object and
then just stringifying the whole thing.

* Finish revamping `dict_new()`

* Add 'from x import *' syntax.

This is a separate opcode in CPython so I added it as such here.

* Add test for dicts

* added functions

* ran rustfmt and fixed isidentifier

* fixed zfill and make_title

* python3.6 doesn't contain isascii()
2018-12-27 20:22:04 +01:00
Gitea
b726e675ff Add format builtin and String formatting stuff.
This includes everything needed to call str.format with integers
as positional and keyword parameters.
2018-12-15 19:46:09 -05:00
Windel Bouwman
5053d6d167 Add bytes literal support. 2018-10-28 21:15:46 +01:00
Akshay Verma
4da6c94602 Added test for capitalize method to string 2018-10-18 16:46:43 +02:00
Akshay Verma
8c04cb5dc3 Added tests for capitalize method to string 2018-10-18 16:25:27 +02:00
Windel Bouwman
d650476f85 Add additional methods to string objects 2018-09-29 10:31:59 +02:00
Adam Kelly
8816e5d362 Implement more complete version of str_repr. 2018-09-02 13:05:03 +01:00
Adam Kelly
7277e63a53 Add vm.to_repr and call for formatting list/tuple/dict elements. 2018-09-02 12:09:57 +01:00
Adam Kelly
91a11e25c2 Replace str built-in with str.__new__ 2018-08-24 15:13:06 +01:00
Daniel Watkins
3861fd898e Implement triple-quotes for strings
This fixes #33.
2018-08-08 23:36:32 -04:00