Skip to content

Commit

Permalink
Added earlier recognition of intrinsic type in declarations (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
eirik-kjonstad authored May 16, 2021
1 parent 0a16258 commit d37ca1e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modern-fortran.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ contexts:
types:
- match: '(?i)\b{{intrinsicType}}\b(?=.*(function))' # type of return value in function
scope: storage.type.intrinsic.fortran
- match: '(?i){{firstOnLine}}\b{{intrinsicType}}(?=\,)' # type declaration
scope: storage.type.intrinsic.fortran
- match: '(?i){{firstOnLine}}\b{{intrinsicType}}(?=\(.*\)\,)' # type declaration
scope: storage.type.intrinsic.fortran
- match: '(?i){{firstOnLine}}\b{{intrinsicType}}\b(?=.*::)' # type declaration
scope: storage.type.intrinsic.fortran
- match: '(?i)\b(in|out|inout)\b'
Expand Down
29 changes: 29 additions & 0 deletions syntax_test_fortran.F90
Original file line number Diff line number Diff line change
Expand Up @@ -924,3 +924,32 @@ MODULE SUBROUTINE MY_SUBROUTINE(A, B, C)
! ^^^ keyword.declaration.class.fortran
! ^^^^ keyword.declaration.class.fortran
! ^^^^^^^^^^^ entity.name.class.fortran
real(54)
! ^^^^ support.function.intrinsic.fortran
! ^ meta.parens.fortran punctuation.section.parens.begin.fortran
! ^^ meta.parens.fortran meta.number.integer.decimal.fortran constant.numeric.value.fortran
! ^ meta.parens.fortran punctuation.section.parens.end.fortran
!
real(dp),
! ^^^^ storage.type.intrinsic.fortran
! ^ meta.parens.fortran punctuation.section.parens.begin.fortran
! ^^ meta.parens.fortran variable.other.fortran
! ^ meta.parens.fortran punctuation.section.parens.end.fortran
! ^ punctuation.separator.comma.fortran
!
real(dp) ::
! ^^^^ storage.type.intrinsic.fortran
! ^ meta.parens.fortran punctuation.section.parens.begin.fortran
! ^^ meta.parens.fortran variable.other.fortran
! ^ meta.parens.fortran punctuation.section.parens.end.fortran
! ^^ punctuation.separator.double-colon.fortran
!
real, dimension
! ^^^^ storage.type.intrinsic.fortran
! ^ punctuation.separator.comma.fortran
! ^^^^^^^^^ storage.modifier.fortran
!
integer, dimension
! ^^^^ storage.type.intrinsic.fortran


0 comments on commit d37ca1e

Please sign in to comment.