summaryrefslogtreecommitdiffstatshomepage
path: root/py/builtineval.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-21 21:40:13 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-21 21:40:13 +0000
commit55baff4c9bcbc001cbb8972c289ebfa356d4665b (patch)
treebd086f9ddf8c5f2db9642ee04fc382064ebd2029 /py/builtineval.c
parent91d457a27752fa125e9c6107bf51c918e021dc95 (diff)
downloadmicropython-55baff4c9bcbc001cbb8972c289ebfa356d4665b.tar.gz
micropython-55baff4c9bcbc001cbb8972c289ebfa356d4665b.zip
Revamp qstrs: they now include length and hash.
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
Diffstat (limited to 'py/builtineval.c')
-rw-r--r--py/builtineval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/py/builtineval.c b/py/builtineval.c
index c7bd6b6298..67072a0fa7 100644
--- a/py/builtineval.c
+++ b/py/builtineval.c
@@ -8,6 +8,7 @@
#include "nlr.h"
#include "misc.h"
#include "mpconfig.h"
+#include "qstr.h"
#include "lexer.h"
#include "lexerunix.h"
#include "parse.h"
@@ -19,10 +20,11 @@
#include "builtin.h"
static mp_obj_t mp_builtin_eval(mp_obj_t o_in) {
- const char *str = qstr_str(mp_obj_get_qstr(o_in));
+ uint str_len;
+ const byte *str = qstr_data(mp_obj_get_qstr(o_in), &str_len);
// create the lexer
- mp_lexer_t *lex = mp_lexer_new_from_str_len("<string>", str, strlen(str), 0);
+ mp_lexer_t *lex = mp_lexer_new_from_str_len("<string>", (const char*)str, str_len, 0);
// parse the string
qstr parse_exc_id;