summaryrefslogtreecommitdiff
path: root/py/lexer.c
diff options
context:
space:
mode:
authorbvernoux <bvernoux@gmail.com>2014-06-03 19:26:34 +0200
committerbvernoux <bvernoux@gmail.com>2014-06-03 19:26:34 +0200
commit82560fce75ab0307182c943d564202e55fca6c09 (patch)
treed20162c8647ddb2451fdb76024761821b43149e8 /py/lexer.c
parent0a1dbfe02f4a693c202b97aafcf0b5d0ba050812 (diff)
parentb294a7e3c9b84aad6c331128a51e0d69e7845141 (diff)
Merge branch 'master' of https://github.com/micropython/micropython
Diffstat (limited to 'py/lexer.c')
-rw-r--r--py/lexer.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/py/lexer.c b/py/lexer.c
index 4a7ac071b..26993922e 100644
--- a/py/lexer.c
+++ b/py/lexer.c
@@ -64,12 +64,7 @@ struct _mp_lexer_t {
mp_token_t tok_cur;
};
-// debug flag for __debug__ constant
-STATIC mp_token_kind_t mp_debug_value;
-
-void mp_set_debug(bool value) {
- mp_debug_value = value ? MP_TOKEN_KW_TRUE : MP_TOKEN_KW_FALSE;
-}
+uint mp_optimise_value;
// TODO replace with a call to a standard function
bool str_strn_equal(const char *str, const char *strn, int len) {
@@ -703,7 +698,7 @@ STATIC void mp_lexer_next_token_into(mp_lexer_t *lex, mp_token_t *tok, bool firs
if (str_strn_equal(tok_kw[i], tok->str, tok->len)) {
if (i == ARRAY_SIZE(tok_kw) - 1) {
// tok_kw[ARRAY_SIZE(tok_kw) - 1] == "__debug__"
- tok->kind = mp_debug_value;
+ tok->kind = (mp_optimise_value == 0 ? MP_TOKEN_KW_TRUE : MP_TOKEN_KW_FALSE);
} else {
tok->kind = MP_TOKEN_KW_FALSE + i;
}