provide less mysterious error messages when seeing end-of-line in

single-quoted strings or end-of-file in triple-quoted strings.
closes patch 586561.
This commit is contained in:
Skip Montanaro 2002-08-15 01:20:16 +00:00
parent 90e9a79afd
commit 118ec70ea2
3 changed files with 14 additions and 3 deletions

View file

@ -1276,14 +1276,17 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
c = tok_nextc(tok);
if (c == '\n') {
if (!triple) {
tok->done = E_TOKEN;
tok->done = E_EOLS;
tok_backup(tok, c);
return ERRORTOKEN;
}
tripcount = 0;
}
else if (c == EOF) {
tok->done = E_TOKEN;
if (triple)
tok->done = E_EOFS;
else
tok->done = E_EOLS;
tok->cur = tok->inp;
return ERRORTOKEN;
}
@ -1305,7 +1308,7 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end)
tripcount = 0;
c = tok_nextc(tok);
if (c == EOF) {
tok->done = E_TOKEN;
tok->done = E_EOLS;
tok->cur = tok->inp;
return ERRORTOKEN;
}