From ac060e78a3978ecef96ad68a2136f7f07e298cd1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 12 Nov 2002 07:27:04 +0000 Subject: [PATCH] (): Don't worry about any backslash escapes other than \\ and \'; this simplifies the code. (): Likewise, for \\ and \". (): Escape $ and @, too. Use new escapes @{ and @} for [ and ]. --- src/scan-gram.l | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/scan-gram.l b/src/scan-gram.l index b944235..8f18c35 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -469,10 +469,9 @@ splice (\\[ \f\t\v]*\n)* { - "'" YY_OBS_GROW; BEGIN c_context; - \\{splice}[^\[\]] YY_OBS_GROW; - {splice} YY_OBS_GROW; - <> unexpected_end_of_file (yylloc, "'"); + "'" YY_OBS_GROW; BEGIN c_context; + \\{splice}[\'\\] YY_OBS_GROW; + <> unexpected_end_of_file (yylloc, "'"); } @@ -483,10 +482,9 @@ splice (\\[ \f\t\v]*\n)* { - "\"" YY_OBS_GROW; BEGIN c_context; - \\{splice}[^\[\]] YY_OBS_GROW; - {splice} YY_OBS_GROW; - <> unexpected_end_of_file (yylloc, "\""); + "\"" YY_OBS_GROW; BEGIN c_context; + \\{splice}[\"\\] YY_OBS_GROW; + <> unexpected_end_of_file (yylloc, "\""); } @@ -578,8 +576,10 @@ splice (\\[ \f\t\v]*\n)* { - \[ obstack_sgrow (&string_obstack, "@<:@"); - \] obstack_sgrow (&string_obstack, "@:>@"); + \$ obstack_sgrow (&string_obstack, "$]["); + \@ obstack_sgrow (&string_obstack, "@@"); + \[ obstack_sgrow (&string_obstack, "@{"); + \] obstack_sgrow (&string_obstack, "@}"); .|\n YY_OBS_GROW; } -- 2.7.4