mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Polish redbean serialization
This commit is contained in:
parent
7aafa64ab3
commit
2d1731b995
24 changed files with 828 additions and 158 deletions
9
third_party/lua/lobject.c
vendored
9
third_party/lua/lobject.c
vendored
|
@ -27,7 +27,6 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#define lobject_c
|
||||
#define LUA_CORE
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "third_party/lua/lctype.h"
|
||||
#include "third_party/lua/ldebug.h"
|
||||
#include "third_party/lua/ldo.h"
|
||||
|
@ -285,6 +284,14 @@ static const char *l_str2int (const char *s, lua_Integer *result) {
|
|||
empty = 0;
|
||||
}
|
||||
}
|
||||
if (s[0] == '0' &&
|
||||
(s[1] == 'b' || s[1] == 'B')) { /* [jart] binary */
|
||||
s += 2; /* skip '0b' */
|
||||
for (; lisbdigit(cast_uchar(*s)); s++) {
|
||||
a = a * 2 + (*s - '0');
|
||||
empty = 0;
|
||||
}
|
||||
}
|
||||
else if (s[0] == '0') { /* [jart] octal is the best radix */
|
||||
for (s += 1; lisdigit(cast_uchar(*s)); s++) {
|
||||
int d = *s - '0';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue