Skip to content

Commit

Permalink
Allow ';'
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Oct 27, 2017
1 parent ee805a4 commit 73c95f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fortran.g4
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ param_list
statement
:
( IDENT '=' expr
| subroutine_call
| 'exit'
| subroutine_call
| if_statement
) NEWLINE+
) (NEWLINE+ | ';')
;

if_statement
Expand Down
7 changes: 7 additions & 0 deletions tests/test_expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ def test_statements():
call rand_gamma0(a, .false., x(i))
call rand_gamma_vector_n(a, size(x), x)
end subroutine
""", r)
assert parse("""\
subroutine a
x = 1; y = 2
y = 5; a = 1; x = u(2)
a = 5
end subroutine
""", r)

def test_control_flow():
Expand Down

0 comments on commit 73c95f8

Please sign in to comment.