mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 22:24:04 +02:00
feat(fortran): fortran support
This commit is contained in:
parent
c3e07c3695
commit
729cafed11
3 changed files with 82 additions and 1 deletions
|
@ -43,6 +43,7 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [x] `dart`
|
||||
- [x] `elixir`
|
||||
- [x] `fish`
|
||||
- [x] `fortran`
|
||||
- [x] `go`
|
||||
- [x] `graphql`
|
||||
- [x] `html_tags`
|
||||
|
@ -54,6 +55,7 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [x] `lua`
|
||||
- [x] `markdown`
|
||||
- [x] `matlab`
|
||||
- [x] `norg`
|
||||
- [x] `ocaml_interface`
|
||||
- [x] `ocaml`
|
||||
- [x] `php`
|
||||
|
@ -142,7 +144,6 @@ use 'nvim-treesitter/nvim-treesitter-context'
|
|||
- [ ] `menhir`
|
||||
- [ ] `mermaid`
|
||||
- [ ] `meson`
|
||||
- [x] `norg`
|
||||
- [ ] `nickel`
|
||||
- [ ] `nix`
|
||||
- [ ] `ocamllex`
|
||||
|
|
33
queries/fortran/context.scm
Normal file
33
queries/fortran/context.scm
Normal file
|
@ -0,0 +1,33 @@
|
|||
(program
|
||||
(program_statement (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(derived_type_definition
|
||||
(derived_type_statement (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(do_loop_statement
|
||||
(loop_control_expression (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(subroutine
|
||||
(subroutine_statement (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(if_statement
|
||||
(parenthesized_expression (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(elseif_clause
|
||||
(parenthesized_expression (_))
|
||||
(_) @context.end
|
||||
) @context
|
||||
|
||||
(else_clause
|
||||
(_) @context.end
|
||||
) @context
|
47
test/test.f90
Normal file
47
test/test.f90
Normal file
|
@ -0,0 +1,47 @@
|
|||
program
|
||||
foo
|
||||
|
||||
|
||||
|
||||
|
||||
type
|
||||
eigensys_t
|
||||
|
||||
real(idp) :: bar1(:,:)
|
||||
|
||||
|
||||
|
||||
integer :: n
|
||||
end type eigensys_t
|
||||
|
||||
do i = 1,
|
||||
eigensystem%n
|
||||
|
||||
write(*,'(" Eigenvector ",I1,": ")') i
|
||||
|
||||
|
||||
write(*,*) eigensystem%eigen_vecs(:,i)
|
||||
end do
|
||||
|
||||
contains
|
||||
subroutine aaaaaaaa(foo,
|
||||
bar)
|
||||
|
||||
if (
|
||||
foo /= 0) then
|
||||
|
||||
|
||||
! jask
|
||||
else if (
|
||||
foo /= 1) then
|
||||
|
||||
|
||||
foo = foo + 1
|
||||
else
|
||||
|
||||
!das
|
||||
bar = 2
|
||||
endif
|
||||
end subroutine get_eigensystem
|
||||
|
||||
end program foo
|
Loading…
Reference in a new issue