+2006-07-01 Tobias Schl\81üter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/19259
+ * parse.c (next_free): Error out on line starting with semicolon.
+ (next_fixed): Fix formatting. Error out on line starting with
+ semicolon.
+
2006-06-30 Kazu Hirata <kazu@codesourcery.com>
* check.c: Fix a comment typo.
next_free (void)
{
match m;
- int c, d, cnt;
+ int c, d, cnt, at_bol;
+ at_bol = gfc_at_bol ();
gfc_gobble_whitespace ();
c = gfc_peek_char ();
gfc_gobble_whitespace ();
+ if (at_bol && gfc_peek_char () == ';')
+ {
+ gfc_error_now
+ ("Semicolon at %C needs to be preceded by statement");
+ gfc_next_char (); /* Eat up the semicolon. */
+ return ST_NONE;
+ }
+
if (gfc_match_eos () == MATCH_YES)
{
gfc_warning_now
}
}
+ if (at_bol && c == ';')
+ {
+ gfc_error_now ("Semicolon at %C needs to be preceded by statement");
+ gfc_next_char (); /* Eat up the semicolon. */
+ return ST_NONE;
+ }
+
return decode_statement ();
}
if (c == '\n')
goto blank_line;
- if (c != ' ' && c!= '0')
+ if (c != ' ' && c != '0')
{
gfc_buffer_error (0);
gfc_error ("Bad continuation line at %C");
goto blank_line;
gfc_current_locus = loc;
+ if (c == ';')
+ {
+ gfc_error_now ("Semicolon at %C needs to be preceded by statement");
+ return ST_NONE;
+ }
+
if (gfc_match_eos () == MATCH_YES)
goto blank_line;
+2006-07-01 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
+
+ PR fortran/19259
+ * gfortran.dg/semicolon_fixed.c: New.
+ * gfortran.dg/semicolon_free.c: New.
+
2006-06-30 Mike Stump <mrs@apple.com>
* g++.dg/ext/visibility/fvisibility-override2.C: Fix for systems
--- /dev/null
+! { dg-do compile }
+! PR 19259 Semicolon cannot start a line
+ x=1; y=1;
+ x=2;;
+ x=3;
+ ; ! { dg-error "Semicolon at" }
+ ;; ! { dg-error "Semicolon at" }
+ 900 ; ! { dg-error "Semicolon at" }
+ end
--- /dev/null
+! { dg-do compile }
+! PR 19259 Semicolon cannot start a line
+x=1; y=1;
+x=2;;
+x=3;
+ ; ! { dg-error "Semicolon at" }
+;; ! { dg-error "Semicolon at" }
+111 ; ! { dg-error "Semicolon at" }
+end