Skip to content

Erroneous syntax highlighting with subroutine names and preprocessor conditionals #278

Closed
@gnikit

Description

@gnikit

Describe the bug
end subroutine surrounded by preprocessor conditionals is erroneous

Screenshots
image

image

Code sample

  function blasmul_mm(A, B) result(C)
    !!< Use DGEMM to multiply A * B and get C.

    real, dimension(:, :), intent(in) :: A, B
    real, dimension(size(A, 1), size(B, 2)) :: C

    interface
#ifdef DOUBLEP
      SUBROUTINE DGEMM ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, &
                         BETA, C, LDC )
#else
      SUBROUTINE SGEMM ( TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, &
                         BETA, C, LDC )
#endif
      CHARACTER*1        TRANSA, TRANSB
      INTEGER            M, N, K, LDA, LDB, LDC
      REAL               ALPHA, BETA
      REAL               A( LDA, * ), B( LDB, * ), C( LDC, * )
#ifdef DOUBLEP
      END SUBROUTINE DGEMM
#else
      END SUBROUTINE SGEMM
#endif
    end interface

    assert(size(A, 2) == size(B, 1))

#ifdef DOUBLEP
    call DGEMM('N', 'N', size(A, 1), size(B, 2), size(A, 2), 1.0, A, size(A, 1), B, size(B, 1), &
               0.0, C, size(A, 1))
#else
    call SGEMM('N', 'N', size(A, 1), size(B, 2), size(A, 2), 1.0, A, size(A, 1), B, size(B, 1), &
               0.0, C, size(A, 1))
#endif 
  end function blasmul_mm

Fortran Form
Free form (F90+)

Build info (please complete the following information):

  • OS: Linux x64
  • Extension Version :2.5.0 internal dev version
  • Visual Studio Code Version: 1.63.0-insider

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions