Wednesday, February 15, 2012

Re: Change needed in cobol.vim syntax file.

On Feb 16, 10:26 am, john Culleton <J...@wexfordpress.com> wrote:
>
> I started with pre-COBOL 68, in 1968.  The IF statement and the
> AT END statements were legal then and still are legal in all the
> compilers I have used.  I am reasonably certain they were legal
> in the very first COBOL compiler written by Grace Murray Hopper
> and her crew.   So there is a fault in cobol.vim. Yes, I
> have cobol_legacy_code set. That should not cause IF and END to
> be highlighted as errors. There is a problem with cobol.vim, like
> it or not.

(Hey, we're friendlier than that here. Such belaboured sarcasm may
not be appreciated.)

I'm not an expert at syntax files, but I've hacked a few...

The vim command

:echo synIDattr(synID(line("."), col("."), 1), "name")

show the lines in question being highlighted as the "group name"
cobolBadLine, which appears to me to have nothing to do with the lines
in question.

I suggest copying $VIMRUNTIME/syntax/cobol.vim to $HOME/.vim/syntax
(or whatever your system has) and change the line 148 that starts

syn region cobolCondFlow contains=ALLBUT,cobolLine start=...

to

syn region cobolCondFlow contains=ALLBUT,cobolLine,cobolBadLine
start=...

to stop cobolBadLine being recognized there.

(Syntax gurus, I understand why there is

syn match cobolBadLine "\s\+\*.*" contained

but what

syn match cobolBadLine "[^ D\*$/-].*" contained

is for or what it does I've no idea.)

Regards, John

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: