Kaydet (Commit) 3ec664f5 authored tarafından Colomban Wendling's avatar Colomban Wendling

Merge Fortran fixes from Alexander Eberspächer

Closes PR#145 and PR#146 by cherry-picking their commits.
......@@ -84,6 +84,7 @@ typedef enum eKeywordId {
KEYWORD_equivalence,
KEYWORD_extends,
KEYWORD_external,
KEYWORD_forall,
KEYWORD_format,
KEYWORD_function,
KEYWORD_if,
......@@ -107,6 +108,7 @@ typedef enum eKeywordId {
KEYWORD_pointer,
KEYWORD_precision,
KEYWORD_private,
KEYWORD_procedure,
KEYWORD_program,
KEYWORD_public,
KEYWORD_pure,
......@@ -249,6 +251,7 @@ static const keywordDesc FortranKeywordTable [] = {
{ "equivalence", KEYWORD_equivalence },
{ "extends", KEYWORD_extends },
{ "external", KEYWORD_external },
{ "forall", KEYWORD_forall },
{ "format", KEYWORD_format },
{ "function", KEYWORD_function },
{ "if", KEYWORD_if },
......@@ -272,6 +275,7 @@ static const keywordDesc FortranKeywordTable [] = {
{ "pointer", KEYWORD_pointer },
{ "precision", KEYWORD_precision },
{ "private", KEYWORD_private },
{ "procedure", KEYWORD_procedure },
{ "program", KEYWORD_program },
{ "public", KEYWORD_public },
{ "pure", KEYWORD_pure },
......@@ -1123,6 +1127,7 @@ static boolean isTypeSpec (tokenInfo *const token)
case KEYWORD_logical:
case KEYWORD_record:
case KEYWORD_type:
case KEYWORD_procedure:
result = TRUE;
break;
default:
......@@ -1185,6 +1190,7 @@ static void parseTypeSpec (tokenInfo *const token)
case KEYWORD_integer:
case KEYWORD_logical:
case KEYWORD_real:
case KEYWORD_procedure:
readToken (token);
if (isType (token, TOKEN_PAREN_OPEN))
skipOverParens (token); /* skip kind-selector */
......@@ -2045,7 +2051,8 @@ static boolean parseExecutionPart (tokenInfo *const token)
if (isSecondaryKeyword (token, KEYWORD_do) ||
isSecondaryKeyword (token, KEYWORD_if) ||
isSecondaryKeyword (token, KEYWORD_select) ||
isSecondaryKeyword (token, KEYWORD_where))
isSecondaryKeyword (token, KEYWORD_where) ||
isSecondaryKeyword (token, KEYWORD_forall))
{
skipToNextStatement (token);
result = TRUE;
......
......@@ -120,6 +120,7 @@ test_sources = \
enum.java \
events.cs \
extern_variable.h \
forall_module.f90 \
format.pl \
func_typedef.h \
general.cs \
......@@ -184,6 +185,7 @@ test_sources = \
objectivec_property.mm \
objectivec_protocol.mm \
Package.pm \
procedure_pointer_module.f90 \
property.cs \
prototype.h \
pure_elem.f95 \
......
! a module that uses a forall block
module with_forall
real :: a
contains
subroutine sub_with_forall(x)
real, intent(inout) :: x(:)
integer :: i
forall(i=1:size(x))
x(i) = 0.5**i
end forall
end subroutine sub_with_forall
function two() result(res)
real :: res
res = 2.0
end function two
end module with_forall
# format=tagmanager
a16384with_forall0
sub_with_forall64with_forall0
two16with_forall0
with_forall2560
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment