summaryrefslogtreecommitdiff
path: root/src/scan-skel.l
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-07-27 11:11:19 +0200
committerAkim Demaille <akim@lrde.epita.fr>2012-07-27 12:13:40 +0200
commit4d24ffb75ebfc7c4fae027e23132c6d3630998b5 (patch)
tree587965074b7cc97a51509f0bf10c91ba0e5b3c93 /src/scan-skel.l
parenta74a3158d47827616b2d5fc282b7ad4bf69c4261 (diff)
downloadbison-4d24ffb75ebfc7c4fae027e23132c6d3630998b5.tar.gz
style changes in the scanners
* src/scan-code.l, src/scan-skel.l: Use a more traditional indentation style for start-conditions. Prefer "continue" to a comment, for empty actions. Strip useless {}. Remove useless start-condition clauses.
Diffstat (limited to 'src/scan-skel.l')
-rw-r--r--src/scan-skel.l40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/scan-skel.l b/src/scan-skel.l
index 24339057..862b34fd 100644
--- a/src/scan-skel.l
+++ b/src/scan-skel.l
@@ -72,8 +72,8 @@ static void fail_for_invalid_at (char const *at);
"@@" fputc ('@', yyout);
"@{" fputc ('[', yyout);
"@}" fputc (']', yyout);
-"@`" /* Empty. Used by b4_cat in ../data/bison.m4. */
-@\n /* Likewise. */
+"@`" continue; /* Used by b4_cat in ../data/bison.m4. */
+@\n continue;
"@oline@" fprintf (yyout, "%d", out_lineno + 1);
"@ofile@" QPUTS (outname);
@@ -87,11 +87,11 @@ static void fail_for_invalid_at (char const *at);
}
/* This pattern must not match more than the previous @ patterns. */
-@[^@{}`(\n]* fail_for_invalid_at (yytext);
-\n out_lineno++; ECHO;
-[^@\n]+ ECHO;
+@[^@{}`(\n]* fail_for_invalid_at (yytext);
+\n out_lineno++; ECHO;
+[^@\n]+ ECHO;
-<INITIAL><<EOF>> {
+<<EOF>> {
if (outname)
{
free (outname);
@@ -100,15 +100,15 @@ static void fail_for_invalid_at (char const *at);
return EOF;
}
-<SC_AT_DIRECTIVE_ARGS>{
- [^@]+ { STRING_GROW; }
+<SC_AT_DIRECTIVE_ARGS>
+{
+ [^@]+ STRING_GROW;
- "@@" { obstack_1grow (&obstack_for_string, '@'); }
- "@{" { obstack_1grow (&obstack_for_string, '['); }
- "@}" { obstack_1grow (&obstack_for_string, ']'); }
- "@`" /* Empty. Useful for starting an argument
- that begins with whitespace. */
- @\n /* Empty. */
+ "@@" obstack_1grow (&obstack_for_string, '@');
+ "@{" obstack_1grow (&obstack_for_string, '[');
+ "@}" obstack_1grow (&obstack_for_string, ']');
+ "@`" continue; /* For starting an argument that begins with whitespace. */
+ @\n continue;
@[,)] {
if (at_directive_argc >= AT_DIRECTIVE_ARGC_MAX)
@@ -131,15 +131,17 @@ static void fail_for_invalid_at (char const *at);
}
}
- @.? { fail_for_invalid_at (yytext); }
+ @.? fail_for_invalid_at (yytext);
}
-<SC_AT_DIRECTIVE_SKIP_WS>{
- [ \t\r\n]
- . { yyless (0); BEGIN SC_AT_DIRECTIVE_ARGS; }
+<SC_AT_DIRECTIVE_SKIP_WS>
+{
+ [ \t\r\n] continue;
+ . { yyless (0); BEGIN SC_AT_DIRECTIVE_ARGS; }
}
-<SC_AT_DIRECTIVE_ARGS,SC_AT_DIRECTIVE_SKIP_WS>{
+<SC_AT_DIRECTIVE_ARGS,SC_AT_DIRECTIVE_SKIP_WS>
+{
<<EOF>> {
fatal (_("unclosed %s directive in skeleton"), at_directive_argv[0]);
}