0

I have a file with some subroutines.

The syntax is like

subroutine sub_name_1
    ...
endsub

/* or optionally */

subroutine sub_name_2 {
    ...
}

There are called like call sub_name_1. I can't give arguments there, there is nothing of "(", ")", ";" behind. Maybe some space characters.

I'm looking for a possibility to "collect" all the name behind the subroutine keywords an highlight them not only after the subroutine keyword but also after the call keywords if exist. It would be best if I could color them in another way if the sub not exists. If i comment, it shouldn't work.

Example:

call sub_name_1  /* "sub_name_1" should be highlighted e.g. yellow */
call sub_name_2  /* "sub_name_2"  -"- */
call sub_name_3  /* "sub_name_3" doesn't exists (outcommented). Should be e.g. red */

subroutine sub_name_1
endsub

subroutine sub_name_2 {
}

/*
subroutine sub_name_3
endsub
*/

Is this possible?

I already found class & function names highlighting in Vim but this is not all I'm looking for. There is no highlighting of just existing subs.

romainl
  • 186,200
  • 21
  • 280
  • 313
Andy A.
  • 1,392
  • 5
  • 15
  • 28
  • Have you take a look to https://github.com/vim-syntastic/syntastic ? Or perhaps https://github.com/prabirshrestha/vim-lsp if there lsp already checking your languages – Ôrel Jan 12 '22 at 13:39
  • @Ôrel - Looks good to get some function :) . It's not so easy I think. And no my "language" (or whatever this syntax could be called...) is definitly not provided by anything. But I have a checking tool (puh:). Thanks so far! – Andy A. Jan 12 '22 at 16:33

0 Answers0