Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ assumed_size_spec ::= (explicit_shape_spec ',')* (expr ':')? '*'
// R522
implied_shape_spec ::= (expr ':')? '*'
// R523
private intent_spec ::= in_ | out_ | inout_
private intent_spec ::= (in_ out_) | inout_ | in_ | out_
// R524
access_stmt ::= label_decl? access_spec (('::')? <<list access_id>>)? { pin = 2; extends=specification_stmt }
// R525
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class FortranParsingTest : FortranBaseParsingTestCase() {
@Test
fun testOOP() = doParsingTest(FortranTestDataFixture().navigationMetadata("OOP.f95"))

@Throws(Exception::class)
@Test
fun testIntent() = doParsingTest(FortranTestDataFixture().navigationMetadata("Intent.f95"))

@Throws(Exception::class)
@Test
fun testInterface() = doParsingTest(FortranTestDataFixture().navigationMetadata("Interface.f95"))
Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/psi/Intent.f95
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SUBROUTINE foo(a, b, c, d)
IMPLICIT NONE
INTEGER, INTENT(IN) :: a
INTEGER, INTENT(OUT) :: b
INTEGER, INTENT(INOUT) :: c
INTEGER, INTENT(IN OUT) :: d
END SUBROUTINE foo
108 changes: 108 additions & 0 deletions src/test/resources/psi/Intent.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
FILE
FortranSubroutineSubprogramImpl(SUBROUTINE)
FortranSubroutineStmtImpl(SUBROUTINE_STMT)
PsiElement(keyword)('SUBROUTINE')
PsiWhiteSpace(' ')
FortranEntityDeclImpl(ENTITY_DECL)
PsiElement(identifier)('foo')
PsiElement(()('(')
FortranDataPathImpl(DATA_PATH)
PsiElement(identifier)('a')
PsiElement(,)(',')
PsiWhiteSpace(' ')
FortranDataPathImpl(DATA_PATH)
PsiElement(identifier)('b')
PsiElement(,)(',')
PsiWhiteSpace(' ')
FortranDataPathImpl(DATA_PATH)
PsiElement(identifier)('c')
PsiElement(,)(',')
PsiWhiteSpace(' ')
FortranDataPathImpl(DATA_PATH)
PsiElement(identifier)('d')
PsiElement())(')')
PsiElement(eol)('\n')
PsiWhiteSpace(' ')
FortranBlockImpl(BLOCK)
IMPLICIT_STMT
PsiElement(keyword)('IMPLICIT')
PsiWhiteSpace(' ')
PsiElement(keyword)('NONE')
PsiElement(eol)('\n')
PsiWhiteSpace(' ')
FortranTypeDeclarationStmtImpl(TYPE_DECLARATION_STMT)
NUMBER_TYPE_SPEC
PsiElement(integer)('INTEGER')
PsiElement(,)(',')
PsiWhiteSpace(' ')
ATTR_SPEC
PsiElement(keyword)('INTENT')
PsiElement(()('(')
PsiElement(keyword)('IN')
PsiElement())(')')
PsiWhiteSpace(' ')
PsiElement(::)('::')
PsiWhiteSpace(' ')
FortranEntityDeclImpl(ENTITY_DECL)
PsiElement(identifier)('a')
PsiElement(eol)('\n')
PsiWhiteSpace(' ')
FortranTypeDeclarationStmtImpl(TYPE_DECLARATION_STMT)
NUMBER_TYPE_SPEC
PsiElement(integer)('INTEGER')
PsiElement(,)(',')
PsiWhiteSpace(' ')
ATTR_SPEC
PsiElement(keyword)('INTENT')
PsiElement(()('(')
PsiElement(keyword)('OUT')
PsiElement())(')')
PsiWhiteSpace(' ')
PsiElement(::)('::')
PsiWhiteSpace(' ')
FortranEntityDeclImpl(ENTITY_DECL)
PsiElement(identifier)('b')
PsiElement(eol)('\n')
PsiWhiteSpace(' ')
FortranTypeDeclarationStmtImpl(TYPE_DECLARATION_STMT)
NUMBER_TYPE_SPEC
PsiElement(integer)('INTEGER')
PsiElement(,)(',')
PsiWhiteSpace(' ')
ATTR_SPEC
PsiElement(keyword)('INTENT')
PsiElement(()('(')
PsiElement(keyword)('INOUT')
PsiElement())(')')
PsiWhiteSpace(' ')
PsiElement(::)('::')
PsiWhiteSpace(' ')
FortranEntityDeclImpl(ENTITY_DECL)
PsiElement(identifier)('c')
PsiElement(eol)('\n')
PsiWhiteSpace(' ')
FortranTypeDeclarationStmtImpl(TYPE_DECLARATION_STMT)
NUMBER_TYPE_SPEC
PsiElement(integer)('INTEGER')
PsiElement(,)(',')
PsiWhiteSpace(' ')
ATTR_SPEC
PsiElement(keyword)('INTENT')
PsiElement(()('(')
PsiElement(keyword)('IN')
PsiWhiteSpace(' ')
PsiElement(keyword)('OUT')
PsiElement())(')')
PsiWhiteSpace(' ')
PsiElement(::)('::')
PsiWhiteSpace(' ')
FortranEntityDeclImpl(ENTITY_DECL)
PsiElement(identifier)('d')
PsiElement(eol)('\n')
END_SUBROUTINE_STMT
PsiElement(keyword)('END')
PsiWhiteSpace(' ')
PsiElement(keyword)('SUBROUTINE')
PsiWhiteSpace(' ')
FortranDataPathImpl(DATA_PATH)
PsiElement(identifier)('foo')