diff options
author | Tobias Burnus <burnus@gcc.gnu.org> | 2010-06-25 21:01:04 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2010-06-25 21:01:04 +0200 |
commit | c6c73c51ca12bd7672d17726416dd95519e15747 (patch) | |
tree | 219f02c65a2d3d51c0c49468db6604dc929faedd | |
parent | 8e7745dce20f0cf618b50afab811955e37a7da10 (diff) | |
download | gcc-c6c73c51ca12bd7672d17726416dd95519e15747.zip gcc-c6c73c51ca12bd7672d17726416dd95519e15747.tar.gz gcc-c6c73c51ca12bd7672d17726416dd95519e15747.tar.bz2 |
parse.c (next_free, next_fixed): Allow ";" as first character.
2010-06-25 Tobias Burnus <burnus@net-b.de>
* parse.c (next_free, next_fixed): Allow ";" as first character.
2010-06-25 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/semicolon_fixed.f: Update.
* gfortran.dg/semicolon_fixed_2.f: New.
* gfortran.dg/semicolon_free_2.f90: New.
* gfortran.dg/semicolon_free.f90: Update.
From-SVN: r161405
-rw-r--r-- | gcc/fortran/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/semicolon_fixed.f | 8 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/semicolon_fixed_2.f | 12 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/semicolon_free.f90 | 1 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/semicolon_free_2.f90 | 10 |
7 files changed, 48 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e887e6f..b635aec 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2010-06-25 Tobias Burnus <burnus@net-b.de> + + * parse.c (next_free, next_fixed): Allow ";" as first character. + 2010-06-24 Tobias Burnus <burnus@net-b.de> PR fortran/44614 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 26ea73a..50f7957 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -717,7 +717,9 @@ next_free (void) if (at_bol && c == ';') { - gfc_error_now ("Semicolon at %C needs to be preceded by statement"); + if (!(gfc_option.allow_std & GFC_STD_F2008)) + gfc_error_now ("Fortran 2008: Semicolon at %C without preceding " + "statement"); gfc_next_ascii_char (); /* Eat up the semicolon. */ return ST_NONE; } @@ -853,7 +855,11 @@ next_fixed (void) if (c == ';') { - gfc_error_now ("Semicolon at %C needs to be preceded by statement"); + if (digit_flag) + gfc_error_now ("Semicolon at %C needs to be preceded by statement"); + else if (!(gfc_option.allow_std & GFC_STD_F2008)) + gfc_error_now ("Fortran 2008: Semicolon at %C without preceding " + "statement"); return ST_NONE; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a5d0510..85cb46b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2010-06-25 Tobias Burnus <burnus@net-b.de> + + * gfortran.dg/semicolon_fixed.f: Update. + * gfortran.dg/semicolon_fixed_2.f: New. + * gfortran.dg/semicolon_free_2.f90: New. + * gfortran.dg/semicolon_free.f90: Update. + 2010-06-25 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/44448 @@ -57,7 +64,7 @@ 2010-06-24 Andi Kleen <ak@linux.intel.com> - * c-c++-common/warn-omitted-condop.c: New. + * c-c++-common/warn-omitted-condop.c: New. 2010-06-24 Tobias Burnus <burnus@net-b.de> diff --git a/gcc/testsuite/gfortran.dg/semicolon_fixed.f b/gcc/testsuite/gfortran.dg/semicolon_fixed.f index 2c667ae..1629764 100644 --- a/gcc/testsuite/gfortran.dg/semicolon_fixed.f +++ b/gcc/testsuite/gfortran.dg/semicolon_fixed.f @@ -1,9 +1,11 @@ ! { dg-do compile } -! PR 19259 Semicolon cannot start a line +! { dg-do options "-std=f2003" } +! +! PR 19259 Semicolon cannot start a line (in F2003) x=1; y=1; x=2;; x=3; - ; ! { dg-error "Semicolon at" } - ;; ! { dg-error "Semicolon at" } + ; ! { dg-error "Fortran 2008: Semicolon at" } + ;; ! { dg-error "Fortran 2008: Semicolon at" } 900 ; ! { dg-error "Semicolon at" } end diff --git a/gcc/testsuite/gfortran.dg/semicolon_fixed_2.f b/gcc/testsuite/gfortran.dg/semicolon_fixed_2.f new file mode 100644 index 0000000..d4f3862c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/semicolon_fixed_2.f @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-do options "-std=f2008" } + +! PR 19259 Semicolon cannot start a line +! but it F2008 it can! + x=1; y=1; + x=2;; + x=3; + ; ! OK + ;; ! OK + 900 ; ! { dg-error "Semicolon at" } + end diff --git a/gcc/testsuite/gfortran.dg/semicolon_free.f90 b/gcc/testsuite/gfortran.dg/semicolon_free.f90 index 28e8da2..4d05d83 100644 --- a/gcc/testsuite/gfortran.dg/semicolon_free.f90 +++ b/gcc/testsuite/gfortran.dg/semicolon_free.f90 @@ -1,4 +1,5 @@ ! { dg-do compile } +! { dg-options "-std=f2003" } ! PR 19259 Semicolon cannot start a line x=1; y=1; x=2;; diff --git a/gcc/testsuite/gfortran.dg/semicolon_free_2.f90 b/gcc/testsuite/gfortran.dg/semicolon_free_2.f90 new file mode 100644 index 0000000..2fae26e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/semicolon_free_2.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! { dg-options "-std=f2008" } +! PR 19259 Semicolon cannot start a line +x=1; y=1; +x=2;; +x=3; + ; ! OK +;; ! OK +111 ; ! { dg-error "Semicolon at" } +end |