diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 18:20:53 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-08-02 18:20:53 +0300 |
commit | 23356c2d522bf17b4acb314f7aa6503a62db2765 (patch) | |
tree | 12e82b306c973dfd1b361ca87de47967424d3ddf | |
parent | c1f670b26671cc8d60d967bbcb42cb8deb3baf2b (diff) | |
download | egawk-23356c2d522bf17b4acb314f7aa6503a62db2765.tar.gz egawk-23356c2d522bf17b4acb314f7aa6503a62db2765.tar.bz2 egawk-23356c2d522bf17b4acb314f7aa6503a62db2765.zip |
Add lint warning for escaped newlines.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | awkgram.c | 2 | ||||
-rw-r--r-- | awkgram.y | 2 | ||||
-rw-r--r-- | node.c | 2 |
4 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2018-08-02 Arnold D. Robbins <arnold@skeeve.com> + + * awkgram.y (yylex): Add lint warning upon encountering escaped + physical newlines in a string. + * node.c (make_str_node): Ditto. + 2018-07-31 Arnold D. Robbins <arnold@skeeve.com> * interpret.h (unfield): Add a call to force_string() on @@ -6274,6 +6274,8 @@ retry: if (c == '\n') { if (do_posix) fatal(_("POSIX does not allow physical newlines in string values")); + else if (do_lint) + lintwarn(_("backslash string continuation is not portable")); sourceline++; continue; } @@ -3854,6 +3854,8 @@ retry: if (c == '\n') { if (do_posix) fatal(_("POSIX does not allow physical newlines in string values")); + else if (do_lint) + lintwarn(_("backslash string continuation is not portable")); sourceline++; continue; } @@ -450,7 +450,7 @@ make_str_node(const char *s, size_t len, int flags) c = parse_escape(&pf); if (c < 0) { if (do_lint) - lintwarn(_("backslash at end of string")); + lintwarn(_("backslash string continuation is not portable")); if ((flags & ELIDE_BACK_NL) != 0) continue; c = '\\'; |