mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Apply fixes and speedups
This commit is contained in:
parent
7521bf9e73
commit
725f4d79f6
36 changed files with 682 additions and 334 deletions
6
third_party/python/Parser/tokenizer.c
vendored
6
third_party/python/Parser/tokenizer.c
vendored
|
@ -243,7 +243,6 @@ get_normal_name(const char *s) /* for utf-8 and latin-1 */
|
|||
}
|
||||
|
||||
/* Return the coding spec in S, or NULL if none is found. */
|
||||
|
||||
static int
|
||||
get_coding_spec(const char *s, char **spec, Py_ssize_t size, struct tok_state *tok)
|
||||
{
|
||||
|
@ -267,12 +266,10 @@ get_coding_spec(const char *s, char **spec, Py_ssize_t size, struct tok_state *t
|
|||
do {
|
||||
t++;
|
||||
} while (t[0] == '\x20' || t[0] == '\t');
|
||||
|
||||
begin = t;
|
||||
while (Py_ISALNUM(t[0]) ||
|
||||
t[0] == '-' || t[0] == '_' || t[0] == '.')
|
||||
t++;
|
||||
|
||||
if (begin < t) {
|
||||
char* r = new_string(begin, t - begin, tok);
|
||||
const char* q;
|
||||
|
@ -1127,9 +1124,7 @@ tok_backup(struct tok_state *tok, int c)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* Return the token corresponding to a single character */
|
||||
|
||||
int
|
||||
PyToken_OneChar(int c)
|
||||
{
|
||||
|
@ -1161,7 +1156,6 @@ PyToken_OneChar(int c)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PyToken_TwoChars(int c1, int c2)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue