[Info-vax] cobol.vim for VIM
Bill Gunshannon
billg999 at cs.uofs.edu
Fri Mar 6 08:15:14 EST 2009
In article <nt0sl.24262$ZP4.12175 at nlpi067.nbdc.sbc.com>,
Michael Austin <maustin at firstdbasource.com> writes:
> Hein RMS van den Heuvel wrote:
>> Years ago "Mark Vilstrup Svanesteen" wrote..
>> -----------------------------------------------------
>> Date: May 3 2005, 7:55 am
>> Subject: cobol.vim for VIM
>> To: comp.os.vms
>>
>> Hi,
>>
>> I downloaded VIM6.3, but it seems impossible to get it to display
>> COBOL-code
>> correctly. I've been googling all day, but I can't find anything that
>> really
>> works.
>> VIM places red lines all over my COBOL-code. If I try:
>>
>> :hi error none
>>
>> , the red lines disappear allright, but now words are only partly
>> colored.
>> This happens every 6. line I believe.
>>
>> I've also tried putting:
>>
>> let cobol_legacy_code=1
>> and
>> unlet cobol_legacy_code
>>
>> in my .vimrc and .gvimrc - files.
>>
>> Maybe its in my .vimrc-files
>> ---------------------------------------------------
>>
>> But I could not reply to that, hence a new topic.
>>
>> I just tried VIM (7.0 + syntax 7.2) on COBOL and the color
>> highlighting was very ugly to begin with. The cobol syntax really
>> wants the 'ANSII' style layout where the columns matter a lot and a
>> space is a space, not a tab. Not the largely free-format we VMS folks
>> are used to.
>>
>> I could make it 'almost bareable' with a quick HACK.
>> I do not claim to understand this, and the solution is by no means
>> complete or perfect, but it is a lot better than it was.
>> Basically replaced the markers for 4 - 6 space by 1 or 2 [spaces OR
>> tab]
>>
>> -------
>> syn match cobolMarker "^\%([ ]\{,1\}[^ ]\)\@=.\{,2}"
>> nextgroup=@cobolStart
>> syn match cobolSpace "^[ ]" nextgroup=@cobolStart
>> syn match cobolAreaA "[ ]\{1\}" contained
>> nextgroup=@cobolAreaA, at cobolAreaAB
>> syn match cobolAreaB "[ ]\{2,\}\|- *" contained
>> nextgroup=@cobolAreaB, at cobolAreaAB
>> syn match cobolComment "[/*C].*$" contained
>> -------
>> The pieces of string above looking like "[ ]" contain not two spaces,
>> but a space and a tab.
>>
>> But... it still is a mess. Specifically the KEYWORDS defined with
>> CONTAINING are recognized in any piece of string, and not only when
>> started and ended on some word boundary.
>>
>> So take piece of code like; PERFORM 41000_CLOSE_ALL_FILES ...
>> There 41000 is highlighted in RED (constant !?), CLOSE and ALL in
>> YELLOW (keywords) and FILES in white for simple variable name. Yuck!
>>
>> If anyone has tweaked a COBOL.VIM for use with OpenVMS Cobol, then I'd
>> love to try it!
>>
>> Regards,
>>
>> Hein.
>>
>>
>
> Does anyone know what ever happened to LSE? There was also a COBOL code
> generator IIRC... I learned COBOL using these tools... well, good
> enough that I could read it and attend a Rdb SQL class :)
LSE here (back when we still used VMS for academics) supported most
languages with templates to make creating new programs real easy for
students. I personally remember COBOL, Ada and Pascal. Of course,
the person who wrote those templates has long since retired and I
would bet the Datacenter has neither retained or preserved any of them.
bill
--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
billg999 at cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
More information about the Info-vax
mailing list