Hi,
Currently we are evaluating Zeus as our future editor for writing Cobol (and Delta) programs. So far we have managed to define the Cobol and Delta language for Syntax highlighting. One problem we still have is comment recognition in 'free format' COBOL and ANSI Cobol.
For 'free format' COBOL a comment will start on the first column and in ANSI Cobol format it starts on column 7.
Until now we are not able to define the language recognize both.
The settings in Cobol.zki for comments are as follows:
LineComment01=0:*
CommentStart02=
CommentEnd02=
NestsComments02=No
LineComment02=7:*
These setting will result in correct syntax highlighting for ANSI Cobol format:
000022 INPUT-OUTPUT SECTION. 01000283
000023 FILE-CONTROL. 01000286
000024* ------------------------------------------------> SELECT 01000287
000025 SELECT IVP0001P ASSIGN TO "SFB_IVP0001P". 08000180
000026 DATA DIVISION. 01000303
000027 FILE SECTION. 01000305
000028* ------------------------------------------------> FD 01000306
But for the 'free format' COBOL syntax hihlighting only shows for lines having a "*" at colum 7:
/
********************************************************************************
* CALL_TPINITIALIZE
********************************************************************************
call_tpinitialize SECTION.
begin.
MOVE SPACES TO usrname IN tpinfdef-rec.
Is there a setting possible that both situations will have correct syntax highlighting?
Kind regards,
Peter
[/img]
Cobol comment syntax highlight
Hi Peter,
Unfortunately because of the way the comment parsing works I don't think there is a way to fix this
The best solution that I could suggest is defining the comments as follows:This is just tricking the comment parser by making the comment patterns slightly different 
Those settings will color this ANSI formatted comment correctly:
It will also color this free format comment correctly:
And also this free format comment:
But it will not correctly color this free format comment line:
Cheers Jussi
I have been able to replicate the issue you are seeing and the issue is caused by the fact that both comment patterns are identical.Is there a setting possible that both situations will have correct syntax highlighting?
Unfortunately because of the way the comment parsing works I don't think there is a way to fix this

The best solution that I could suggest is defining the comments as follows:
Code: Select all
Line Comment #1
0:**
Line Comment #2
0:*

Those settings will color this ANSI formatted comment correctly:
Code: Select all
000024* ------------------------------------------------> SELECT 01000287
000025 SELECT IVP0001P ASSIGN TO "SFB_IVP0001P". 08000180
000026 DATA DIVISION. 01000303
000027 FILE SECTION. 01000305
000028* ------------------------------------------------> FD 01000306
Code: Select all
********************************************************************************
** CALL_TPINITIALIZE
********************************************************************************
Code: Select all
********************************************************************************
** CALL_TPINITIALIZE
********************************************************************************
Code: Select all
* CALL_TPINITIALIZE