diff --git a/src/core/multisym.c b/src/core/multisym.c index 35d25f47..b6133c44 100644 --- a/src/core/multisym.c +++ b/src/core/multisym.c @@ -30,7 +30,16 @@ static JanetSlot multisym_parse_part(JanetCompiler *c, const uint8_t *sympart, i if (sympart[0] == ':') { return janetc_cslot(janet_symbolv(sympart, len)); } else { - return janetc_resolve(c, janet_symbol(sympart + 1, len - 1)); + double index; + int err; + index = janet_scan_number(sympart + 1, len - 1, &err); + if (err) { + /* not a number */ + return janetc_resolve(c, janet_symbol(sympart + 1, len - 1)); + } else { + /* is a number */ + return janetc_cslot(janet_wrap_number(index)); + } } } diff --git a/src/core/strtod.c b/src/core/strtod.c index f3aa13bc..afa0c499 100644 --- a/src/core/strtod.c +++ b/src/core/strtod.c @@ -272,6 +272,11 @@ double janet_scan_number( if (str + 1 < end && str[0] == '0' && str[1] == 'x') { base = 16; str += 2; + } else if (str + 1 < end && + str[0] >= '0' && str[0] <= '9' && + str[1] == 'r') { + base = str[0] - '0'; + str += 2; } else if (str + 2 < end && str[0] >= '0' && str[0] <= '9' && str[1] >= '0' && str[1] <= '9' &&