mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-21 11:58:29 +00:00
Make fixes, improvements, and chibicc python bindings
- python now mixes audio 10x faster - python octal notation is restored - chibicc now builds code 3x faster - chibicc now has help documentation - chibicc can now generate basic python bindings - linenoise now supports some paredit-like features See #141
This commit is contained in:
parent
28997f3acb
commit
7061c79c22
121 changed files with 5272 additions and 1928 deletions
6
third_party/chibicc/unicode.c
vendored
6
third_party/chibicc/unicode.c
vendored
|
@ -60,7 +60,7 @@ uint32_t decode_utf8(char **new_pos, char *p) {
|
|||
return c;
|
||||
}
|
||||
|
||||
static bool in_range(uint32_t *range, uint32_t c) {
|
||||
static bool in_range(const uint32_t *range, uint32_t c) {
|
||||
for (int i = 0; range[i] != -1; i += 2) {
|
||||
if (range[i] <= c && c <= range[i + 1]) {
|
||||
return true;
|
||||
|
@ -80,7 +80,7 @@ static bool in_range(uint32_t *range, uint32_t c) {
|
|||
// 0x00BE-0x00C0 are allowed, while neither ⟘ (U+27D8) nor ' '
|
||||
// (U+3000, full-width space) are allowed because they are out of range.
|
||||
bool is_ident1(uint32_t c) {
|
||||
static uint32_t range[] = {
|
||||
static const uint32_t range[] = {
|
||||
0x00A8, 0x00A8, 0x00AA, 0x00AA, 0x00AD, 0x00AD, 0x00AF, 0x00AF,
|
||||
0x00B2, 0x00B5, 0x00B7, 0x00BA, 0x00BC, 0x00BE, 0x00C0, 0x00D6,
|
||||
0x00D8, 0x00F6, 0x00F8, 0x00FF, 0x0100, 0x02FF, 0x0370, 0x167F,
|
||||
|
@ -106,7 +106,7 @@ bool is_ident1(uint32_t c) {
|
|||
// Returns true if a given character is acceptable as a non-first
|
||||
// character of an identifier.
|
||||
bool is_ident2(uint32_t c) {
|
||||
static uint32_t range[] = {
|
||||
static const uint32_t range[] = {
|
||||
0x0300, 0x036F, 0x1DC0, 0x1DFF, 0x20D0, 0x20FF, 0xFE20, 0xFE2F, -1,
|
||||
};
|
||||
if (is_ident1(c)) return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue