diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-20 17:19:15 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2015-03-20 17:19:15 +0200 |
commit | a31a42403b841ef05ca9143a431c8b6f1021a958 (patch) | |
tree | 09668a5683a34d8fcc114c105a6148dd3b717b26 /awkgram.c | |
parent | 2473b938036dfdd32ff47833ea032a80a6fa5659 (diff) | |
parent | 480aca31c7772dafeb1b97cd7a768bca2f49d3c7 (diff) | |
download | egawk-a31a42403b841ef05ca9143a431c8b6f1021a958.tar.gz egawk-a31a42403b841ef05ca9143a431c8b6f1021a958.tar.bz2 egawk-a31a42403b841ef05ca9143a431c8b6f1021a958.zip |
Merge branch 'master' into select
Diffstat (limited to 'awkgram.c')
-rw-r--r-- | awkgram.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -5536,7 +5536,7 @@ yylex(void) if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */ return 0; - c = nextc(true); + c = nextc(! want_regexp); if (c == END_SRC) return 0; if (c == END_FILE) @@ -5578,12 +5578,12 @@ yylex(void) want_regexp = false; tok = tokstart; for (;;) { - c = nextc(true); + c = nextc(false); if (gawk_mb_cur_max == 1 || nextc_is_1stbyte) switch (c) { case '[': /* one day check for `.' and `=' too */ - if (nextc(true) == ':' || in_brack == 0) + if (nextc(false) == ':' || in_brack == 0) in_brack++; pushback(); break; @@ -5595,11 +5595,14 @@ yylex(void) in_brack--; break; case '\\': - if ((c = nextc(true)) == END_FILE) { + if ((c = nextc(false)) == END_FILE) { pushback(); yyerror(_("unterminated regexp ends with `\\' at end of file")); goto end_regexp; /* kludge */ - } else if (c == '\n') { + } + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); + if (c == '\n') { sourceline++; continue; } else { @@ -5813,7 +5816,7 @@ retry: return lasttok = '*'; case '/': - if (nextc(true) == '=') { + if (nextc(false) == '=') { pushback(); return lasttok = SLASH_BEFORE_EQUAL; } @@ -5948,6 +5951,8 @@ retry: if ((gawk_mb_cur_max == 1 || nextc_is_1stbyte) && c == '\\') { c = nextc(true); + if (c == '\r') /* allow MS-DOS files. bleah */ + c = nextc(true); if (c == '\n') { sourceline++; continue; |