[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/9] style: factor common bits about string scanning
From: |
Akim Demaille |
Subject: |
[PATCH 4/9] style: factor common bits about string scanning |
Date: |
Sat, 13 Jun 2020 17:23:12 +0200 |
* src/scan-gram.l: here.
---
src/scan-gram.l | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/scan-gram.l b/src/scan-gram.l
index 3b03923a..ad254694 100644
--- a/src/scan-gram.l
+++ b/src/scan-gram.l
@@ -566,8 +566,6 @@ eqopt ({sp}=)?
_("POSIX Yacc does not support string literals"));
RETURN_VALUE (STRING, last_string);
}
- <<EOF>> unexpected_eof (token_start, "\"");
- {eol} unexpected_newline (token_start, "\"");
}
<SC_ESCAPED_TSTRING>
@@ -580,10 +578,15 @@ eqopt ({sp}=)?
_("POSIX Yacc does not support string literals"));
RETURN_VALUE (TSTRING, last_string);
}
+}
+
+<SC_ESCAPED_STRING,SC_ESCAPED_TSTRING>
+{
<<EOF>> unexpected_eof (token_start, "\"");
"\n" unexpected_newline (token_start, "\"");
}
+
/*----------------------------------------------------------.
| Scanning a Bison character literal, decoding its escapes. |
| The initial quote is already eaten. |
--
2.27.0
- [PATCH 0/9] Fix reports, Akim Demaille, 2020/06/13
- [PATCH 1/9] style: prefer 'FOO ()' to 'FOO' for function-like macros, Akim Demaille, 2020/06/13
- [PATCH 2/9] style: reduce scopes, Akim Demaille, 2020/06/13
- [PATCH 3/9] style: introduce & use STRING_1GROW, Akim Demaille, 2020/06/13
- [PATCH 4/9] style: factor common bits about string scanning,
Akim Demaille <=
- [PATCH 5/9] tests: check reports with conflicts and UTF-8, Akim Demaille, 2020/06/13
- [PATCH 6/9] parser: keep string aliases as the user wrote it, Akim Demaille, 2020/06/13
- [PATCH 7/9] regen, Akim Demaille, 2020/06/13
- [PATCH 8/9] reports: don't escape the labels, Akim Demaille, 2020/06/13
- [PATCH 9/9] reports: the column width differs from the byte count, Akim Demaille, 2020/06/13