Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 1364:132602d854d8 legacy-trunk
Changes to accept double-quoted strings on input.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 26 Oct 1993 15:19:44 +0000 |
| parents | fccd415e2eb8 |
| children | 89e1e5d9ccbf |
line wrap: on
line diff
--- a/Python/compile.c Tue Oct 26 10:23:14 1993 +0000 +++ b/Python/compile.c Tue Oct 26 15:19:44 1993 +0000 @@ -481,13 +481,14 @@ char *buf; char *p; int c; - if (*s != '\'') { + int quote = *s; + if (quote != '\'' && quote != '\"') { err_badcall(); return NULL; } s++; len = strlen(s); - if (s[--len] != '\'') { + if (s[--len] != quote) { err_badcall(); return NULL; } @@ -505,6 +506,7 @@ /* XXX This assumes ASCII! */ case '\\': *p++ = '\\'; break; case '\'': *p++ = '\''; break; + case '\"': *p++ = '\"'; break; case 'b': *p++ = '\b'; break; case 'f': *p++ = '\014'; break; /* FF */ case 't': *p++ = '\t'; break;
