Skip to content

Commit

Permalink
style: factor common bits about string scanning
Browse files Browse the repository at this point in the history
* src/scan-gram.l: here.
  • Loading branch information
akimd committed Jun 13, 2020
1 parent 826db68 commit f94afb5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/scan-gram.l
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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. |
Expand Down

0 comments on commit f94afb5

Please sign in to comment.