py/lexer: Add support for underscores in numeric literals.

This is a very convenient feature introduced in Python 3.6 by PEP 515.
This commit is contained in:
Damien George
2018-06-02 00:21:46 +10:00
parent b2fa1b50ed
commit 6a445b60fa
6 changed files with 36 additions and 0 deletions

View File

@@ -590,6 +590,8 @@ void mp_lexer_to_next(mp_lexer_t *lex) {
}
vstr_add_char(&lex->vstr, CUR_CHAR(lex));
next_char(lex);
} else if (is_char(lex, '_')) {
next_char(lex);
} else {
break;
}