diff options
| author | Dan Halbert <halbert@halwitz.org> | 2019-02-15 19:19:52 -0500 |
|---|---|---|
| committer | Dan Halbert <halbert@halwitz.org> | 2019-02-15 19:19:52 -0500 |
| commit | 5a32c88db300216450292e370aa449da5e7c58f8 (patch) | |
| tree | cec546f733155ab6d31e89092cf4eca7f3999b4b | |
| parent | 68d39d1f3f97e49abbefa5c36aed9d7e97b8980f (diff) | |
| parent | 35e3d99f62f908f6f371667b13120e20edb1142f (diff) | |
merge from upstream and move ure options;make translate
| -rw-r--r-- | extmod/modure.c | 232 | ||||
| -rw-r--r-- | extmod/re1.5/compilecode.c | 46 | ||||
| -rw-r--r-- | locale/ID.po | 83 | ||||
| -rw-r--r-- | locale/circuitpython.pot | 82 | ||||
| -rw-r--r-- | locale/de_DE.po | 83 | ||||
| -rw-r--r-- | locale/en_US.po | 82 | ||||
| -rw-r--r-- | locale/es.po | 83 | ||||
| -rw-r--r-- | locale/fil.po | 83 | ||||
| -rw-r--r-- | locale/fr.po | 83 | ||||
| -rw-r--r-- | locale/it_IT.po | 83 | ||||
| -rw-r--r-- | locale/pt_BR.po | 82 | ||||
| -rw-r--r-- | ports/circuitpy-common/mpconfig_circuitpy.h | 3 | ||||
| -rwxr-xr-x | py/mpconfig.h | 12 | ||||
| -rw-r--r-- | py/objstr.c | 9 | ||||
| -rw-r--r-- | py/objstr.h | 2 | ||||
| -rw-r--r-- | py/objstrunicode.c | 20 | ||||
| -rw-r--r-- | tests/extmod/ure1.py | 13 | ||||
| -rw-r--r-- | tests/extmod/ure_groups.py | 33 | ||||
| -rw-r--r-- | tests/extmod/ure_span.py | 40 | ||||
| -rw-r--r-- | tests/extmod/ure_sub.py | 61 | ||||
| -rw-r--r-- | tests/extmod/ure_sub_unmatched.py | 19 | ||||
| -rw-r--r-- | tests/extmod/ure_sub_unmatched.py.exp | 1 |
22 files changed, 879 insertions, 356 deletions
diff --git a/extmod/modure.c b/extmod/modure.c index 1a7027026..a368ee8fa 100644 --- a/extmod/modure.c +++ b/extmod/modure.c @@ -77,8 +77,83 @@ STATIC mp_obj_t match_group(mp_obj_t self_in, mp_obj_t no_in) { } MP_DEFINE_CONST_FUN_OBJ_2(match_group_obj, match_group); +#if MICROPY_PY_URE_MATCH_GROUPS + +STATIC mp_obj_t match_groups(mp_obj_t self_in) { + mp_obj_match_t *self = MP_OBJ_TO_PTR(self_in); + if (self->num_matches <= 1) { + return mp_const_empty_tuple; + } + mp_obj_tuple_t *groups = MP_OBJ_TO_PTR(mp_obj_new_tuple(self->num_matches - 1, NULL)); + for (int i = 1; i < self->num_matches; ++i) { + groups->items[i - 1] = match_group(self_in, MP_OBJ_NEW_SMALL_INT(i)); + } + return MP_OBJ_FROM_PTR(groups); +} +MP_DEFINE_CONST_FUN_OBJ_1(match_groups_obj, match_groups); + +#endif + +#if MICROPY_PY_URE_MATCH_SPAN_START_END + +STATIC void match_span_helper(size_t n_args, const mp_obj_t *args, mp_obj_t span[2]) { + mp_obj_match_t *self = MP_OBJ_TO_PTR(args[0]); + + mp_int_t no = 0; + if (n_args == 2) { + no = mp_obj_get_int(args[1]); + if (no < 0 || no >= self->num_matches) { + nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, args[1])); + } + } + + mp_int_t s = -1; + mp_int_t e = -1; + const char *start = self->caps[no * 2]; + if (start != NULL) { + // have a match for this group + const char *begin = mp_obj_str_get_str(self->str); + s = start - begin; + e = self->caps[no * 2 + 1] - begin; + } + + span[0] = mp_obj_new_int(s); + span[1] = mp_obj_new_int(e); +} + +STATIC mp_obj_t match_span(size_t n_args, const mp_obj_t *args) { + mp_obj_t span[2]; + match_span_helper(n_args, args, span); + return mp_obj_new_tuple(2, span); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(match_span_obj, 1, 2, match_span); + +STATIC mp_obj_t match_start(size_t n_args, const mp_obj_t *args) { + mp_obj_t span[2]; + match_span_helper(n_args, args, span); + return span[0]; +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(match_start_obj, 1, 2, match_start); + +STATIC mp_obj_t match_end(size_t n_args, const mp_obj_t *args) { + mp_obj_t span[2]; + match_span_helper(n_args, args, span); + return span[1]; +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(match_end_obj, 1, 2, match_end); + +#endif + STATIC const mp_rom_map_elem_t match_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_group), MP_ROM_PTR(&match_group_obj) }, + #if MICROPY_PY_URE_MATCH_GROUPS + { MP_ROM_QSTR(MP_QSTR_groups), MP_ROM_PTR(&match_groups_obj) }, + #endif + #if MICROPY_PY_URE_MATCH_SPAN_START_END + { MP_ROM_QSTR(MP_QSTR_span), MP_ROM_PTR(&match_span_obj) }, + { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&match_start_obj) }, + { MP_ROM_QSTR(MP_QSTR_end), MP_ROM_PTR(&match_end_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(match_locals_dict, match_locals_dict_table); @@ -103,6 +178,35 @@ STATIC mp_obj_t ure_exec(bool is_anchored, uint n_args, const mp_obj_t *args) { size_t len; subj.begin = mp_obj_str_get_data(args[1], &len); subj.end = subj.begin + len; +#if MICROPY_PY_URE_MATCH_SPAN_START_END + if (n_args > 2) { + const mp_obj_type_t *self_type = mp_obj_get_type(args[1]); + mp_int_t str_len = MP_OBJ_SMALL_INT_VALUE(mp_obj_len_maybe(args[1])); + const byte *begin = (const byte *)subj.begin; + + int pos = mp_obj_get_int(args[2]); + if (pos >= str_len) { + return mp_const_none; + } + if (pos < 0) { + pos = 0; + } + const byte *pos_ptr = str_index_to_ptr(self_type, begin, len, MP_OBJ_NEW_SMALL_INT(pos), true); + + const byte *endpos_ptr = (const byte *)subj.end; + if (n_args > 3) { + int endpos = mp_obj_get_int(args[3]); + if (endpos <= pos) { + return mp_const_none; + } + // Will cap to length + endpos_ptr = str_index_to_ptr(self_type, begin, len, args[3], true); + } + + subj.begin = (const char *)pos_ptr; + subj.end = (const char *)endpos_ptr; + } +#endif int caps_num = (self->re.sub + 1) * 2; mp_obj_match_t *match = m_new_obj_var(mp_obj_match_t, char*, caps_num); // cast is a workaround for a bug in msvc: it treats const char** as a const pointer instead of a pointer to pointer to const char @@ -174,10 +278,127 @@ STATIC mp_obj_t re_split(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(re_split_obj, 2, 3, re_split); +#if MICROPY_PY_URE_SUB + +STATIC mp_obj_t re_sub_helper(mp_obj_t self_in, size_t n_args, const mp_obj_t *args) { + mp_obj_re_t *self = MP_OBJ_TO_PTR(self_in); + mp_obj_t replace = args[1]; + mp_obj_t where = args[2]; + mp_int_t count = 0; + if (n_args > 3) { + count = mp_obj_get_int(args[3]); + // Note: flags are currently ignored + } + + size_t where_len; + const char *where_str = mp_obj_str_get_data(where, &where_len); + Subject subj; + subj.begin = where_str; + subj.end = subj.begin + where_len; + int caps_num = (self->re.sub + 1) * 2; + + vstr_t vstr_return; + vstr_return.buf = NULL; // We'll init the vstr after the first match + mp_obj_match_t *match = mp_local_alloc(sizeof(mp_obj_match_t) + caps_num * sizeof(char*)); + match->base.type = &match_type; + match->num_matches = caps_num / 2; // caps_num counts start and end pointers + match->str = where; + + for (;;) { + // cast is a workaround for a bug in msvc: it treats const char** as a const pointer instead of a pointer to pointer to const char + memset((char*)match->caps, 0, caps_num * sizeof(char*)); + int res = re1_5_recursiveloopprog(&self->re, &subj, match->caps, caps_num, false); + + // If we didn't have a match, or had an empty match, it's time to stop + if (!res || match->caps[0] == match->caps[1]) { + break; + } + + // Initialise the vstr if it's not already + if (vstr_return.buf == NULL) { + vstr_init(&vstr_return, match->caps[0] - subj.begin); + } + + // Add pre-match string + vstr_add_strn(&vstr_return, subj.begin, match->caps[0] - subj.begin); + + // Get replacement string + const char* repl = mp_obj_str_get_str((mp_obj_is_callable(replace) ? mp_call_function_1(replace, MP_OBJ_FROM_PTR(match)) : replace)); + + // Append replacement string to result, substituting any regex groups + while (*repl != '\0') { + if (*repl == '\\') { + ++repl; + bool is_g_format = false; + if (*repl == 'g' && repl[1] == '<') { + // Group specified with syntax "\g<number>" + repl += 2; + is_g_format = true; + } + + if ('0' <= *repl && *repl <= '9') { + // Group specified with syntax "\g<number>" or "\number" + unsigned int match_no = 0; + do { + match_no = match_no * 10 + (*repl++ - '0'); + } while ('0' <= *repl && *repl <= '9'); + if (is_g_format && *repl == '>') { + ++repl; + } + + if (match_no >= (unsigned int)match->num_matches) { + nlr_raise(mp_obj_new_exception_arg1(&mp_type_IndexError, MP_OBJ_NEW_SMALL_INT(match_no))); + } + + const char *start_match = match->caps[match_no * 2]; + if (start_match != NULL) { + // Add the substring matched by group + const char *end_match = match->caps[match_no * 2 + 1]; + vstr_add_strn(&vstr_return, start_match, end_match - start_match); + } + } + } else { + // Just add the current byte from the replacement string + vstr_add_byte(&vstr_return, *repl++); + } + } + + // Move start pointer to end of last match + subj.begin = match->caps[1]; + + // Stop substitutions if count was given and gets to 0 + if (count > 0 && --count == 0) { + break; + } + } + + mp_local_free(match); + + if (vstr_return.buf == NULL) { + // Optimisation for case of no substitutions + return where; + } + + // Add post-match string + vstr_add_strn(&vstr_return, subj.begin, subj.end - subj.begin); + + return mp_obj_new_str_from_vstr(mp_obj_get_type(where), &vstr_return); +} + +STATIC mp_obj_t re_sub(size_t n_args, const mp_obj_t *args) { + return re_sub_helper(args[0], n_args, args); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(re_sub_obj, 3, 5, re_sub); + +#endif + STATIC const mp_rom_map_elem_t re_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_match), MP_ROM_PTR(&re_match_obj) }, { MP_ROM_QSTR(MP_QSTR_search), MP_ROM_PTR(&re_search_obj) }, { MP_ROM_QSTR(MP_QSTR_split), MP_ROM_PTR(&re_split_obj) }, + #if MICROPY_PY_URE_SUB + { MP_ROM_QSTR(MP_QSTR_sub), MP_ROM_PTR(&re_sub_obj) }, + #endif }; STATIC MP_DEFINE_CONST_DICT(re_locals_dict, re_locals_dict_table); @@ -232,11 +453,22 @@ STATIC mp_obj_t mod_re_search(size_t n_args, const mp_obj_t *args) { } MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_search_obj, 2, 4, mod_re_search); +#if MICROPY_PY_URE_SUB +STATIC mp_obj_t mod_re_sub(size_t n_args, const mp_obj_t *args) { + mp_obj_t self = mod_re_compile(1, args); + return re_sub_helper(self, n_args, args); +} +MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_re_sub_obj, 3, 5, mod_re_sub); +#endif + STATIC const mp_rom_map_elem_t mp_module_re_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ure) }, { MP_ROM_QSTR(MP_QSTR_compile), MP_ROM_PTR(&mod_re_compile_obj) }, { MP_ROM_QSTR(MP_QSTR_match), MP_ROM_PTR(&mod_re_match_obj) }, { MP_ROM_QSTR(MP_QSTR_search), MP_ROM_PTR(&mod_re_search_obj) }, + #if MICROPY_PY_URE_SUB + { MP_ROM_QSTR(MP_QSTR_sub), MP_ROM_PTR(&mod_re_sub_obj) }, + #endif { MP_ROM_QSTR(MP_QSTR_DEBUG), MP_ROM_INT(FLAG_DEBUG) }, }; diff --git a/extmod/re1.5/compilecode.c b/extmod/re1.5/compilecode.c index a685a508a..01d3d1498 100644 --- a/extmod/re1.5/compilecode.c +++ b/extmod/re1.5/compilecode.c @@ -10,6 +10,29 @@ #define EMIT(at, byte) (code ? (code[at] = byte) : (at)) #define PC (prog->bytelen) + +static char unescape(char c) { + switch (c) { + case 'a': + return '\a'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 'v': + return '\v'; + case 'x': + return '\\'; + default: + return c; + } +} + + static const char *_compilecode(const char *re, ByteProg *prog, int sizecode) { char *code = sizecode ? NULL : prog->insts; @@ -22,13 +45,16 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode) case '\\': re++; if (!*re) return NULL; // Trailing backslash + term = PC; if ((*re | 0x20) == 'd' || (*re | 0x20) == 's' || (*re | 0x20) == 'w') { - term = PC; EMIT(PC++, NamedClass); EMIT(PC++, *re); - prog->len++; - break; + } else { + EMIT(PC++, Char); + EMIT(PC++, unescape(*re)); } + prog->len++; + break; default: term = PC; EMIT(PC++, Char); @@ -54,11 +80,21 @@ static const char *_compilecode(const char *re, ByteProg *prog, int sizecode) prog->len++; for (cnt = 0; *re != ']'; re++, cnt++) { if (!*re) return NULL; - EMIT(PC++, *re); + if (*re == '\\') { + re += 1; + EMIT(PC++, unescape(*re)); + } else { + EMIT(PC++, *re); + } if (re[1] == '-' && re[2] != ']') { re += 2; } - EMIT(PC++, *re); + if (*re == '\\') { + re += 1; + EMIT(PC++, unescape(*re)); + } else { + EMIT(PC++, *re); + } } EMIT(term + 1, cnt); break; diff --git a/locale/ID.po b/locale/ID.po index 2eed9f09f..2c2712561 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -103,11 +103,11 @@ msgstr "heap kosong" msgid "syntax error in JSON" msgstr "sintaksis error pada JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Memisahkan dengan menggunakan sub-captures" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Error pada regex" @@ -1504,7 +1504,7 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -1654,152 +1654,157 @@ msgstr "" msgid "wrong number of arguments" msgstr "" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "modul tidak ditemukan" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f0106b6af..b1788fc9e 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -103,11 +103,11 @@ msgstr "" msgid "syntax error in JSON" msgstr "" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "" @@ -1470,7 +1470,7 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -1620,152 +1620,156 @@ msgstr "" msgid "wrong number of arguments" msgstr "" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +msgid "offset out of bounds" +msgstr "" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index 9e59243d8..a3cd82c0a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Sebastian Plamauer\n" "Language-Team: \n" @@ -103,11 +103,11 @@ msgstr "leerer heap" msgid "syntax error in JSON" msgstr "Syntaxfehler in JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Teilen mit unter-captures" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Fehler in regex" @@ -1489,7 +1489,7 @@ msgstr "'%s' Objekt unterstützt keine item assignment" msgid "object with buffer protocol required" msgstr "Objekt mit Pufferprotokoll (buffer protocol) erforderlich" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -1639,152 +1639,157 @@ msgstr "" msgid "wrong number of arguments" msgstr "" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "Modul nicht gefunden" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "" diff --git a/locale/en_US.po b/locale/en_US.po index 862336207..11d9d062b 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -103,11 +103,11 @@ msgstr "" msgid "syntax error in JSON" msgstr "" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "" @@ -1470,7 +1470,7 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -1620,152 +1620,156 @@ msgstr "" msgid "wrong number of arguments" msgstr "" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +msgid "offset out of bounds" +msgstr "" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "" diff --git a/locale/es.po b/locale/es.po index 0aa0df0f5..7693b8c8d 100644 --- a/locale/es.po +++ b/locale/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -104,11 +104,11 @@ msgstr "heap vacío" msgid "syntax error in JSON" msgstr "error de sintaxis en JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Dividiendo con sub-capturas" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Error en regex" @@ -1507,7 +1507,7 @@ msgstr "el objeto '%s' no soporta la asignación de elementos" msgid "object with buffer protocol required" msgstr "objeto con protocolo de buffer requerido" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "solo se admiten segmentos con step=1 (alias None)" @@ -1658,158 +1658,163 @@ msgstr "valor de bytes fuera de rango" msgid "wrong number of arguments" msgstr "numero erroneo de argumentos" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "address fuera de límites" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" "join espera una lista de objetos str/bytes consistentes con el mismo objeto" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "separator vacío" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "substring no encontrado" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "índices inicio/final" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "formato de string erroneo" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "un solo '}' encontrado en format string" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "especificador de conversion erroneo" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "el final del formato mientras se busca el especificador de conversión" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "especificador de conversión %c desconocido" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "No coinciden '{' en format" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "se espera ':' despues de un especificaro de tipo format" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" "no se puede cambiar de la numeración automática de campos a la " "especificación de campo manual" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "tuple index fuera de rango" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "atributos aún no soportados" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" "no se puede cambiar de especificación de campo manual a numeración " "automática de campos" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "especificador de formato inválido" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "signo no permitido en el espeficador de string format" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "signo no permitido con el especificador integer format 'c'" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "codigo format desconocido '%c' para el typo de objeto '%s'" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "codigo format desconocido '%c' para el typo de objeto 'float'" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alineación no permitida en el especificador string format" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "codigo format desconocido '%c' para objeto de tipo 'str'" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "format requiere un dict" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "formato incompleto" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "no suficientes argumentos para format string" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "%%c requiere int o char" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "Entero requerido" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carácter no soportado '%c' (0x%x) en índice %d" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" "no todos los argumentos fueron convertidos durante el formato de string" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "no se puede convertir a str implícitamente" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "no se puede convertir el objeto '%q' a %q implícitamente" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "índices de string deben ser enteros, no %s" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "string index fuera de rango" diff --git a/locale/fil.po b/locale/fil.po index 30aea79bd..60c8ea076 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy <me@timothygarcia.ca>\n" "Language-Team: fil\n" @@ -103,11 +103,11 @@ msgstr "walang laman ang heap" msgid "syntax error in JSON" msgstr "sintaks error sa JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Binibiyak gamit ang sub-captures" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "May pagkakamali sa REGEX" @@ -1508,7 +1508,7 @@ msgstr "'%s' object hindi sumusuporta ng item assignment" msgid "object with buffer protocol required" msgstr "object na may buffer protocol kinakailangan" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "ang mga slices lamang na may hakbang = 1 (aka None) ang sinusuportahan" @@ -1659,158 +1659,163 @@ msgstr "bytes value wala sa sakop" msgid "wrong number of arguments" msgstr "mali ang bilang ng argumento" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "wala sa sakop ang address" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" "join umaaasang may listahan ng str/bytes objects na naalinsunod sa self " "object" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "walang laman na separator" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "substring hindi nahanap" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "start/end indeks" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "maling format ang string" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "isang '}' nasalubong sa format string" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "masamang pag convert na specifier" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "sa huli ng format habang naghahanap sa conversion specifier" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "hindi alam ang conversion specifier na %c" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "hindi tugma ang '{' sa format" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "umaasa ng ':' pagkatapos ng format specifier" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" "hindi mapalitan ang awtomatikong field numbering sa manual field " "specification" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "indeks ng tuple wala sa sakop" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "attributes hindi sinusuportahan" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" "hindi mapalitan ang manual field specification sa awtomatikong field " "numbering" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "mali ang format specifier" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "sign hindi maaring string format specifier" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "sign hindi maari sa integer format specifier 'c'" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "hindi alam ang format code '%c' para sa object na ang type ay '%s'" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "hindi alam ang format code '%c' sa object na ang type ay 'float'" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "'=' Gindi pinapayagan ang alignment sa pag specify ng string format" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "hindi alam ang format ng code na '%c' para sa object ng type ay 'str'" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "kailangan ng format ng dict" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "hindi kumpleto ang format key" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "hindi kumpleto ang format" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "kulang sa arguments para sa format string" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "%%c nangangailangan ng int o char" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "kailangan ng int" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "hindi sinusuportahan ang format character na '%c' (0x%x) sa index %d" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "hindi lahat ng arguments na i-convert habang string formatting" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "hindi ma i-convert sa string ng walang pahiwatig" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "hindi maaaring i-convert ang '%q' na bagay sa %q nang walang pahiwatig" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "ang indeks ng string ay dapat na integer, hindi %s" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "indeks ng string wala sa sakop" diff --git a/locale/fr.po b/locale/fr.po index dc74bfc75..dba65e29e 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-12-23 20:05+0100\n" "Last-Translator: Pierrick Couturier <arofarn@arofarn.info>\n" "Language-Team: fr\n" @@ -102,11 +102,11 @@ msgstr "'heap' vide" msgid "syntax error in JSON" msgstr "erreur de syntaxe JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Fractionnement avec des captures 'sub'" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Erreur dans l'expression régulière" @@ -1505,7 +1505,7 @@ msgstr "l'objet '%s' ne supporte pas l'assignation d'éléments" msgid "object with buffer protocol required" msgstr "un objet avec un protocol de tampon est nécessaire" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "seuls les slices avec 'step=1' (cad None) sont supportées" @@ -1657,157 +1657,162 @@ msgstr "valeur des octets hors gamme" msgid "wrong number of arguments" msgstr "mauvais nombres d'arguments" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "adresse hors limites" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "join attend une liste d'objets str/bytes cohérent avec l'objet self" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "séparateur vide" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "rsplit(None,n)" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "sous-chaîne non trouvée" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "indices de début/fin" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "chaîne mal-formée" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "'}' seule rencontrée dans une chaîne de format" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "mauvaise spécification de conversion" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "fin de format en cherchant une spécification de conversion" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "spécification %c de conversion inconnue" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "'{' sans correspondance dans le format" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "':' attendu après la spécification de format" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" "impossible de passer d'une énumération auto des champs à une spécification " "manuelle" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "index du tuple hors gamme" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "attribut pas encore supporté" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" "impossible de passer d'une spécification manuelle des champs à une " "énumération auto" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "spécification de format invalide" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "signe non autorisé dans les spéc. de formats de chaînes de caractères" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "signe non autorisé avec la spéc. de format d'entier 'c'" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "code de format '%c' inconnu pour un objet de type '%s'" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "code de format '%c' inconnu pour un objet de type 'float'" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "'=' alignement non autorisé dans la spéc. de format de chaîne" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "code de format '%c' inconnu pour un objet de type 'str'" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "le format nécessite un dict" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "clé de format incomplète" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "format incomplet" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "pas assez d'arguments pour la chaîne de format" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "%%c nécessite un entier int ou un caractère char" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "entier requis" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "caractère de format '%c' (0x%x) non supporté à l'index %d" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" "tous les arguments n'ont pas été convertis pendant le formatage de la chaîne" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "impossible de convertir en str implicitement" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "impossible de convertir l'objet '%q' en '%q' implicitement" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "les indices de chaîne de caractère doivent être des entiers, pas %s" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "index de chaîne hors gamme" diff --git a/locale/it_IT.po b/locale/it_IT.po index 39aebafcf..7aa4e3b43 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin <enrico.paganin@mail.com>\n" "Language-Team: \n" @@ -103,11 +103,11 @@ msgstr "heap vuoto" msgid "syntax error in JSON" msgstr "errore di sintassi nel JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "Suddivisione con sotto-catture" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Errore nella regex" @@ -1505,7 +1505,7 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "solo slice con step=1 (aka None) sono supportate" @@ -1655,155 +1655,160 @@ msgstr "valore byte fuori intervallo" msgid "wrong number of arguments" msgstr "numero di argomenti errato" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +#, fuzzy +msgid "offset out of bounds" +msgstr "indirizzo fuori limite" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" "join prende una lista di oggetti str/byte consistenti con l'oggetto stesso" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "separatore vuoto" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "sottostringa non trovata" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "stringa di formattazione scorretta" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "'}' singolo presente nella stringa di formattazione" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "specificatore di conversione scorretto" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "specificatore di conversione %s sconosciuto" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "'{' spaiato nella stringa di formattazione" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "':' atteso dopo lo specificatore di formato" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "indice della tupla fuori intervallo" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "attributi non ancora supportati" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "specificatore di formato non valido" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "segno non permesso nello spcificatore di formato della stringa" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "segno non permesso nello spcificatore di formato 'c' della stringa" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "codice di formattaione '%c' sconosciuto per oggetto di tipo '%s'" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "codice di formattazione '%c' sconosciuto per oggetto di tipo 'float'" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "codice di formattazione '%c' sconosciuto per oggetto di tipo 'str'" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "la formattazione richiede un dict" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "formato incompleto" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "argomenti non sufficienti per la stringa di formattazione" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "%%c necessita di int o char" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "intero richiesto" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "carattere di formattazione '%c' (0x%x) non supportato all indice %d" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" "non tutti gli argomenti sono stati convertiti durante la formatazione in " "stringhe" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "impossibile convertire a stringa implicitamente" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "impossibile convertire l'oggetto '%q' implicitamente in %q" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "indici della stringa devono essere interi, non %s" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "indice della stringa fuori intervallo" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 8342f1bee..1e204a42f 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-02-15 18:56-0500\n" +"POT-Creation-Date: 2019-02-15 19:19-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -103,11 +103,11 @@ msgstr "heap vazia" msgid "syntax error in JSON" msgstr "erro de sintaxe no JSON" -#: extmod/modure.c:161 +#: extmod/modure.c:265 msgid "Splitting with sub-captures" msgstr "" -#: extmod/modure.c:207 +#: extmod/modure.c:428 msgid "Error in regex" msgstr "Erro no regex" @@ -1488,7 +1488,7 @@ msgstr "" msgid "object with buffer protocol required" msgstr "" -#: py/objarray.c:413 py/objstr.c:428 py/objstrunicode.c:191 py/objtuple.c:188 +#: py/objarray.c:413 py/objstr.c:437 py/objstrunicode.c:211 py/objtuple.c:188 #: shared-bindings/nvm/ByteArray.c:85 msgid "only slices with step=1 (aka None) are supported" msgstr "" @@ -1638,152 +1638,156 @@ msgstr "" msgid "wrong number of arguments" msgstr "" -#: py/objstr.c:468 +#: py/objstr.c:414 py/objstrunicode.c:118 +msgid "offset out of bounds" +msgstr "" + +#: py/objstr.c:477 msgid "join expects a list of str/bytes objects consistent with self object" msgstr "" -#: py/objstr.c:543 py/objstr.c:648 py/objstr.c:1745 +#: py/objstr.c:552 py/objstr.c:657 py/objstr.c:1754 msgid "empty separator" msgstr "" -#: py/objstr.c:642 +#: py/objstr.c:651 msgid "rsplit(None,n)" msgstr "" -#: py/objstr.c:714 +#: py/objstr.c:723 msgid "substring not found" msgstr "" -#: py/objstr.c:771 +#: py/objstr.c:780 msgid "start/end indices" msgstr "" -#: py/objstr.c:932 +#: py/objstr.c:941 msgid "bad format string" msgstr "" -#: py/objstr.c:954 +#: py/objstr.c:963 msgid "single '}' encountered in format string" msgstr "" -#: py/objstr.c:993 +#: py/objstr.c:1002 msgid "bad conversion specifier" msgstr "" -#: py/objstr.c:997 +#: py/objstr.c:1006 msgid "end of format while looking for conversion specifier" msgstr "" -#: py/objstr.c:999 +#: py/objstr.c:1008 #, c-format msgid "unknown conversion specifier %c" msgstr "" -#: py/objstr.c:1030 +#: py/objstr.c:1039 msgid "unmatched '{' in format" msgstr "" -#: py/objstr.c:1037 +#: py/objstr.c:1046 msgid "expected ':' after format specifier" msgstr "" -#: py/objstr.c:1051 +#: py/objstr.c:1060 msgid "" "can't switch from automatic field numbering to manual field specification" msgstr "" -#: py/objstr.c:1056 py/objstr.c:1084 +#: py/objstr.c:1065 py/objstr.c:1093 msgid "tuple index out of range" msgstr "" -#: py/objstr.c:1072 +#: py/objstr.c:1081 msgid "attributes not supported yet" msgstr "atributos ainda não suportados" -#: py/objstr.c:1080 +#: py/objstr.c:1089 msgid "" "can't switch from manual field specification to automatic field numbering" msgstr "" -#: py/objstr.c:1172 +#: py/objstr.c:1181 msgid "invalid format specifier" msgstr "" -#: py/objstr.c:1193 +#: py/objstr.c:1202 msgid "sign not allowed in string format specifier" msgstr "" -#: py/objstr.c:1201 +#: py/objstr.c:1210 msgid "sign not allowed with integer format specifier 'c'" msgstr "" -#: py/objstr.c:1260 +#: py/objstr.c:1269 #, c-format msgid "unknown format code '%c' for object of type '%s'" msgstr "" -#: py/objstr.c:1332 +#: py/objstr.c:1341 #, c-format msgid "unknown format code '%c' for object of type 'float'" msgstr "" -#: py/objstr.c:1344 +#: py/objstr.c:1353 msgid "'=' alignment not allowed in string format specifier" msgstr "" -#: py/objstr.c:1368 +#: py/objstr.c:1377 #, c-format msgid "unknown format code '%c' for object of type 'str'" msgstr "" -#: py/objstr.c:1416 +#: py/objstr.c:1425 msgid "format requires a dict" msgstr "" -#: py/objstr.c:1425 +#: py/objstr.c:1434 msgid "incomplete format key" msgstr "" -#: py/objstr.c:1483 +#: py/objstr.c:1492 msgid "incomplete format" msgstr "formato incompleto" -#: py/objstr.c:1491 +#: py/objstr.c:1500 msgid "not enough arguments for format string" msgstr "" -#: py/objstr.c:1501 +#: py/objstr.c:1510 #, c-format msgid "%%c requires int or char" msgstr "%%c requer int ou char" -#: py/objstr.c:1508 +#: py/objstr.c:1517 msgid "integer required" msgstr "inteiro requerido" -#: py/objstr.c:1571 +#: py/objstr.c:1580 #, c-format msgid "unsupported format character '%c' (0x%x) at index %d" msgstr "" -#: py/objstr.c:1578 +#: py/objstr.c:1587 msgid "not all arguments converted during string formatting" msgstr "" -#: py/objstr.c:2103 +#: py/objstr.c:2112 msgid "can't convert to str implicitly" msgstr "" -#: py/objstr.c:2107 +#: py/objstr.c:2116 msgid "can't convert '%q' object to %q implicitly" msgstr "" -#: py/objstrunicode.c:134 +#: py/objstrunicode.c:154 #, c-format msgid "string indices must be integers, not %s" msgstr "" -#: py/objstrunicode.c:145 py/objstrunicode.c:164 +#: py/objstrunicode.c:165 py/objstrunicode.c:184 msgid "string index out of range" msgstr "" diff --git a/ports/circuitpy-common/mpconfig_circuitpy.h b/ports/circuitpy-common/mpconfig_circuitpy.h index 86ed3da8d..721b3c538 100644 --- a/ports/circuitpy-common/mpconfig_circuitpy.h +++ b/ports/circuitpy-common/mpconfig_circuitpy.h @@ -187,6 +187,9 @@ typedef long mp_off_t; // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) #define MICROPY_PY_URE (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_FULL_BUILD) +#define MICROPY_PY_URE_SUB (CIRCUITPY_FULL_BUILD) // LONGINT_IMPL_xxx are defined in the Makefile. // diff --git a/py/mpconfig.h b/py/mpconfig.h index a846f6a25..bb7952a8b 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1164,6 +1164,18 @@ typedef double mp_float_t; #define MICROPY_PY_URE (0) #endif +#ifndef MICROPY_PY_URE_MATCH_GROUPS +#define MICROPY_PY_URE_MATCH_GROUPS (0) +#endif + +#ifndef MICROPY_PY_URE_MATCH_SPAN_START_END +#define MICROPY_PY_URE_MATCH_SPAN_START_END (0) +#endif + +#ifndef MICROPY_PY_URE_SUB +#define MICROPY_PY_URE_SUB (0) +#endif + #ifndef MICROPY_PY_UHEAPQ #define MICROPY_PY_UHEAPQ (0) #endif diff --git a/py/objstr.c b/py/objstr.c index 7236d9772..ebd11d5cc 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -408,6 +408,15 @@ mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_i #if !MICROPY_PY_BUILTINS_STR_UNICODE // objstrunicode defines own version +size_t str_offset_to_index(const mp_obj_type_t *type, const byte *self_data, size_t self_len, + size_t offset) { + if (offset > self_len) { + mp_raise_ValueError(translate("offset out of bounds")); + } + + return offset; +} + const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, size_t self_len, mp_obj_t index, bool is_slice) { size_t index_val = mp_get_index(type, self_len, index, is_slice); diff --git a/py/objstr.h b/py/objstr.h index 895130446..0efe62a80 100644 --- a/py/objstr.h +++ b/py/objstr.h @@ -71,6 +71,8 @@ mp_obj_t mp_obj_new_str_of_type(const mp_obj_type_t *type, const byte* data, siz mp_obj_t mp_obj_str_binary_op(mp_binary_op_t op, mp_obj_t lhs_in, mp_obj_t rhs_in); mp_int_t mp_obj_str_get_buffer(mp_obj_t self_in, mp_buffer_info_t *bufinfo, mp_uint_t flags); +size_t str_offset_to_index(const mp_obj_type_t *type, const byte *self_data, size_t self_len, + size_t offset); const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, size_t self_len, mp_obj_t index, bool is_slice); const byte *find_subbytes(const byte *haystack, size_t hlen, const byte *needle, size_t nlen, int direction); diff --git a/py/objstrunicode.c b/py/objstrunicode.c index 03106f987..30000a51e 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -112,6 +112,26 @@ STATIC mp_obj_t uni_unary_op(mp_unary_op_t op, mp_obj_t self_in) { } } +size_t str_offset_to_index(const mp_obj_type_t *type, const byte *self_data, size_t self_len, + size_t offset) { + if (offset > self_len) { + mp_raise_ValueError(translate("offset out of bounds")); + } + + if (type == &mp_type_bytes) { + return offset; + } + + size_t index_val = 0; + const byte *s = self_data; + for (size_t i = 0; i < offset; i++, s++) { + if (!UTF8_IS_CONT(*s)) { + ++index_val; + } + } + return index_val; +} + // Convert an index into a pointer to its lead byte. Out of bounds indexing will raise IndexError or // be capped to the first/last character of the string, depending on is_slice. const byte *str_index_to_ptr(const mp_obj_type_t *type, const byte *self_data, size_t self_len, diff --git a/tests/extmod/ure1.py b/tests/extmod/ure1.py index 54471ed4f..710720c8b 100644 --- a/tests/extmod/ure1.py +++ b/tests/extmod/ure1.py @@ -28,6 +28,19 @@ try: except IndexError: print("IndexError") +r = re.compile(r"\n") +m = r.match("\n") +print(m.group(0)) +m = r.match("\\") +print(m) +r = re.compile(r"[\n-\r]") +m = r.match("\n") +print(m.group(0)) +r = re.compile(r"[\]]") +m = r.match("]") +print(m.group(0)) +print("===") + r = re.compile("[a-cu-z]") m = r.match("a") print(m.group(0)) diff --git a/tests/extmod/ure_groups.py b/tests/extmod/ure_groups.py new file mode 100644 index 000000000..4fac896d7 --- /dev/null +++ b/tests/extmod/ure_groups.py @@ -0,0 +1,33 @@ +# test match.groups() + +try: + import ure as re +except ImportError: + try: + import re + except ImportError: + print("SKIP") + raise SystemExit + +try: + m = re.match(".", "a") + m.groups +except AttributeError: + print('SKIP') + raise SystemExit + + +m = re.match(r'(([0-9]*)([a-z]*)[0-9]*)','1234hello567') +print(m.groups()) + +m = re.match(r'([0-9]*)(([a-z]*)([0-9]*))','1234hello567') +print(m.groups()) + +# optional group that matches +print(re.match(r'(a)?b(c)', 'abc').groups()) + +# optional group that doesn't match +print(re.match(r'(a)?b(c)', 'bc').groups()) + +# only a single match +print(re.match(r'abc', 'abc').groups()) diff --git a/tests/extmod/ure_span.py b/tests/extmod/ure_span.py new file mode 100644 index 000000000..50f44399c --- /dev/null +++ b/tests/extmod/ure_span.py @@ -0,0 +1,40 @@ +# test match.span(), and nested spans + +try: + import ure as re +except ImportError: + try: + import re + except ImportError: + print("SKIP") + raise SystemExit + +try: + m = re.match(".", "a") + m.span +except AttributeError: + print('SKIP') + raise SystemExit + + +def print_spans(match): + print('----') + try: + i = 0 + while True: + print(match.span(i), match.start(i), match.end(i)) + i += 1 + except IndexError: + pass + +m = re.match(r'(([0-9]*)([a-z]*)[0-9]*)','1234hello567') +print_spans(m) + +m = re.match(r'([0-9]*)(([a-z]*)([0-9]*))','1234hello567') +print_spans(m) + +# optional span that matches +print_spans(re.match(r'(a)?b(c)', 'abc')) + +# optional span that doesn't match +print_spans(re.match(r'(a)?b(c)', 'bc')) diff --git a/tests/extmod/ure_sub.py b/tests/extmod/ure_sub.py new file mode 100644 index 000000000..4aeb8650a --- /dev/null +++ b/tests/extmod/ure_sub.py @@ -0,0 +1,61 @@ +try: + import ure as re +except ImportError: + try: + import re + except ImportError: + print('SKIP') + raise SystemExit + +try: + re.sub +except AttributeError: + print('SKIP') + raise SystemExit + + +def multiply(m): + return str(int(m.group(0)) * 2) + +print(re.sub("\d+", multiply, "10 20 30 40 50")) + +print(re.sub("\d+", lambda m: str(int(m.group(0)) // 2), "10 20 30 40 50")) + +def A(): + return "A" +print(re.sub('a', A(), 'aBCBABCDabcda.')) + +print( + re.sub( + r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):', + 'static PyObject*\npy_\\1(void){\n return;\n}\n', + '\n\ndef myfunc():\n\ndef myfunc1():\n\ndef myfunc2():' + ) +) + +print( + re.compile( + '(calzino) (blu|bianco|verde) e (scarpa) (blu|bianco|verde)' + ).sub( + r'\g<1> colore \2 con \g<3> colore \4? ...', + 'calzino blu e scarpa verde' + ) +) + +# no matches at all +print(re.sub('a', 'b', 'c')) + +# with maximum substitution count specified +print(re.sub('a', 'b', '1a2a3a', 2)) + +# invalid group +try: + re.sub('(a)', 'b\\2', 'a') +except: + print('invalid group') + +# invalid group with very large number (to test overflow in uPy) +try: + re.sub('(a)', 'b\\199999999999999999999999999999999999999', 'a') +except: + print('invalid group') diff --git a/tests/extmod/ure_sub_unmatched.py b/tests/extmod/ure_sub_unmatched.py new file mode 100644 index 000000000..4795b3196 --- /dev/null +++ b/tests/extmod/ure_sub_unmatched.py @@ -0,0 +1,19 @@ +# test re.sub with unmatched groups, behaviour changed in CPython 3.5 + +try: + import ure as re +except ImportError: + try: + import re + except ImportError: + print('SKIP') + raise SystemExit + +try: + re.sub +except AttributeError: + print('SKIP') + raise SystemExit + +# first group matches, second optional group doesn't so is replaced with a blank +print(re.sub(r'(a)(b)?', r'\2-\1', '1a2')) diff --git a/tests/extmod/ure_sub_unmatched.py.exp b/tests/extmod/ure_sub_unmatched.py.exp new file mode 100644 index 000000000..1e5f0fda0 --- /dev/null +++ b/tests/extmod/ure_sub_unmatched.py.exp @@ -0,0 +1 @@ +1-a2 |
