annotate runtime/syntax/cobol.vim @ 27181:f9f1e76957a6 v8.2.4119

patch 8.2.4119: build failure when disabling the channel feature Commit: https://github.com/vim/vim/commit/e8741a73e20cd6043dd1610fb4c22ae9d132eb56 Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Mon Jan 17 11:23:45 2022 +0000 patch 8.2.4119: build failure when disabling the channel feature Problem: Build failure when disabling the channel feature. Solution: Adjust #ifdef. (Dominique Pell?, closes https://github.com/vim/vim/issues/9545)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Jan 2022 12:30:05 +0100
parents bd7461db24b3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
2 " Language: COBOL
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
3 " Maintainer: Ankit Jain <ajatkj@yahoo.co.in>
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
4 " (formerly Tim Pope <vimNOSPAM@tpope.info>)
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
5 " (formerly Davyd Ondrejko <vondraco@columbus.rr.com>)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " (formerly Sitaram Chamarty <sitaram@diac.com> and
6647
3af822eb4da5 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 " James Mitchell <james_mitchell@acm.org>)
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
8 " Last Change: 2019 Mar 22
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
9 " Ankit Jain 22.03.2019 Changes & fixes:
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
10 " 1. Include inline comments
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
11 " 2. Use comment highlight for bad lines
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
12 " 3. Change certain 'keywords' to 'matches'
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
13 " for additional highlighting
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
14 " 4. Different highlighting for COPY, GO TO &
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
15 " CALL lines
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
16 " 5. Fix for COMP keyword
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
17 " 6. Fix for PROCEDURE DIVISION highlighting
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
18 " 7. Highlight EXIT PROGRAM like STOP RUN
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
19 " 8. Highlight X & A in PIC clause
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
20 " Tag: #C22032019
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
22 " quit when a syntax file was already loaded
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
23 if exists("b:current_syntax")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " MOST important - else most of the keywords wont work!
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
28 setlocal isk=@,48-57,-,_
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
29
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
30 if !exists('g:cobol_inline_comment')
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
31 let g:cobol_inline_comment=0
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
32 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
36 syn cluster cobolStart contains=cobolAreaA,cobolAreaB,cobolComment,cobolCompiler
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
37 syn cluster cobolAreaA contains=cobolParagraph,cobolSection,cobolDivision
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
38 "syn cluster cobolAreaB contains=
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
39 syn cluster cobolAreaAB contains=cobolLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
40 syn cluster cobolLine contains=cobolReserved
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
41 syn match cobolMarker "^\%( \{,5\}[^ ]\)\@=.\{,6}" nextgroup=@cobolStart
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
42 syn match cobolSpace "^ \{6\}" nextgroup=@cobolStart
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
43 syn match cobolAreaA " \{1,4\}" contained nextgroup=@cobolAreaA,@cobolAreaAB
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
44 syn match cobolAreaB " \{5,\}\|- *" contained nextgroup=@cobolAreaB,@cobolAreaAB
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
45 syn match cobolComment "[/*C].*$" contained
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
46 syn match cobolCompiler "$.*$" contained
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
47 syn match cobolLine ".*$" contained contains=cobolReserved,@cobolLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
48
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
49 "#C22032019: Fix for PROCEDURE DIVISION USING highlighting, removed . from the
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
50 "end of the regex
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
51 "syn match cobolDivision \"[A-Z][A-Z0-9-]*[A-Z0-9]\s\+DIVISION\."he=e-1 contained contains=cobolDivisionName
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
52 syn match cobolDivision "[A-Z][A-Z0-9-]*[A-Z0-9]\s\+DIVISION" contained contains=cobolDivisionName
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
53 syn keyword cobolDivisionName contained IDENTIFICATION ENVIRONMENT DATA PROCEDURE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
54 syn match cobolSection "[A-Z][A-Z0-9-]*[A-Z0-9]\s\+SECTION\."he=e-1 contained contains=cobolSectionName
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
55 syn keyword cobolSectionName contained CONFIGURATION INPUT-OUTPUT FILE WORKING-STORAGE LOCAL-STORAGE LINKAGE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
56 syn match cobolParagraph "\a[A-Z0-9-]*[A-Z0-9]\.\|\d[A-Z0-9-]*[A-Z]\."he=e-1 contained contains=cobolParagraphName
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
57 syn keyword cobolParagraphName contained PROGRAM-ID SOURCE-COMPUTER OBJECT-COMPUTER SPECIAL-NAMES FILE-CONTROL I-O-CONTROL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
58
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
59
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
60 "syn match cobolKeys "^\a\{1,6\}" contains=cobolReserved
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
61 "#C22032019: Remove BY, REPLACING, PROGRAM, TO, IN from 'keyword' group and add
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
62 "to 'match' group or other 'keyword' group
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 syn keyword cobolReserved contained ACCEPT ACCESS ADD ADDRESS ADVANCING AFTER ALPHABET ALPHABETIC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 syn keyword cobolReserved contained ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 syn keyword cobolReserved contained ALTERNATE AND ANY ARE AREA AREAS ASCENDING ASSIGN AT AUTHOR BEFORE BINARY
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
66 syn keyword cobolReserved contained BLANK BLOCK BOTTOM CANCEL CBLL CD CF CH CHARACTER CHARACTERS CLASS
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 syn keyword cobolReserved contained CLOCK-UNITS CLOSE COBOL CODE CODE-SET COLLATING COLUMN COMMA COMMON
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
68 syn keyword cobolReserved contained COMMUNICATIONS COMPUTATIONAL COMPUTE CONTENT CONTINUE
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
69 syn keyword cobolReserved contained CONTROL CONVERTING CORR CORRESPONDING COUNT CURRENCY DATE DATE-COMPILED
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 syn keyword cobolReserved contained DATE-WRITTEN DAY DAY-OF-WEEK DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 syn keyword cobolReserved contained DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn keyword cobolReserved contained DELARATIVES DELETE DELIMITED DELIMITER DEPENDING DESCENDING DESTINATION
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn keyword cobolReserved contained DETAIL DISABLE DISPLAY DIVIDE DIVISION DOWN DUPLICATES DYNAMIC EGI ELSE EMI
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 syn keyword cobolReserved contained ENABLE END-ADD END-COMPUTE END-DELETE END-DIVIDE END-EVALUATE END-IF
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
75 syn keyword cobolReserved contained END-MULTIPLY END-OF-PAGE END-READ END-RECEIVE END-RETURN
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn keyword cobolReserved contained END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
77 syn keyword cobolReserved contained END-WRITE EQUAL ERROR ESI EVALUATE EVERY EXCEPTION EXIT
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
78 syn keyword cobolReserved contained EXTEND EXTERNAL FALSE FD FILLER FINAL FIRST FOOTING FOR FROM
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn keyword cobolReserved contained GENERATE GIVING GLOBAL GREATER GROUP HEADING HIGH-VALUE HIGH-VALUES I-O
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
80 syn keyword cobolReserved contained INDEX INDEXED INDICATE INITIAL INITIALIZE
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
81 syn keyword cobolReserved contained INITIATE INPUT INSPECT INSTALLATION INTO IS JUST
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 syn keyword cobolReserved contained JUSTIFIED KEY LABEL LAST LEADING LEFT LENGTH LOCK MEMORY
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 syn keyword cobolReserved contained MERGE MESSAGE MODE MODULES MOVE MULTIPLE MULTIPLY NATIVE NEGATIVE NEXT NO NOT
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
84 syn keyword cobolReserved contained NUMBER NUMERIC NUMERIC-EDITED OCCURS OF OFF OMITTED ON OPEN
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 syn keyword cobolReserved contained OPTIONAL OR ORDER ORGANIZATION OTHER OUTPUT OVERFLOW PACKED-DECIMAL PADDING
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 syn keyword cobolReserved contained PAGE PAGE-COUNTER PERFORM PF PH PIC PICTURE PLUS POINTER POSITION POSITIVE
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
87 syn keyword cobolReserved contained PRINTING PROCEDURES PROCEDD PURGE QUEUE QUOTES
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 syn keyword cobolReserved contained RANDOM RD READ RECEIVE RECORD RECORDS REDEFINES REEL REFERENCE REFERENCES
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
89 syn keyword cobolReserved contained RELATIVE RELEASE REMAINDER REMOVAL REPLACE REPORT REPORTING
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 syn keyword cobolReserved contained REPORTS RERUN RESERVE RESET RETURN RETURNING REVERSED REWIND REWRITE RF RH
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 syn keyword cobolReserved contained RIGHT ROUNDED RUN SAME SD SEARCH SECTION SECURITY SEGMENT SEGMENT-LIMITED
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 syn keyword cobolReserved contained SELECT SEND SENTENCE SEPARATE SEQUENCE SEQUENTIAL SET SIGN SIZE SORT
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
93 syn keyword cobolReserved contained SORT-MERGE SOURCE STANDARD
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 syn keyword cobolReserved contained STANDARD-1 STANDARD-2 START STATUS STOP STRING SUB-QUEUE-1 SUB-QUEUE-2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 syn keyword cobolReserved contained SUB-QUEUE-3 SUBTRACT SUM SUPPRESS SYMBOLIC SYNC SYNCHRONIZED TABLE TALLYING
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
96 syn keyword cobolReserved contained TAPE TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TOP
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 syn keyword cobolReserved contained TRAILING TRUE TYPE UNIT UNSTRING UNTIL UP UPON USAGE USE USING VALUE VALUES
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
98 syn keyword cobolReserved contained VARYING WHEN WITH WORDS WRITE
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 syn match cobolReserved contained "\<CONTAINS\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 syn match cobolReserved contained "\<\(IF\|INVALID\|END\|EOP\)\>"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 syn match cobolReserved contained "\<ALL\>"
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
102 " #C22032019: Add BY as match instead of keyword: BY not followed by ==
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
103 syn match cobolReserved contained "\<BY\>\s\+\(==\)\@!"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
104 syn match cobolReserved contained "\<TO\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
106 syn cluster cobolLine add=cobolConstant,cobolNumber,cobolPic
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 syn keyword cobolConstant SPACE SPACES NULL ZERO ZEROES ZEROS LOW-VALUE LOW-VALUES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
109 " #C22032019: Fix for many pic clauses
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
110 syn match cobolNumber "\<-\=\d*\.\=\d\+\>" contained
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
111 " syn match cobolPic \"\<S*9\+\>" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
112 syn match cobolPic "\<S*9\+V*9*\>" contained
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
113 syn match cobolPic "\<$*\.\=9\+\>" contained
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
114 syn match cobolPic "\<Z*\.\=9\+\>" contained
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
115 syn match cobolPic "\<V9\+\>" contained
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
116 syn match cobolPic "\<9\+V\>" contained
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
117 " syn match cobolPic \"\<-\+[Z9]\+\>" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
118 syn match cobolPic "\<-*[Z9]\+-*\>" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
119 " #C22032019: Add Z,X and A to cobolPic
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
120 syn match cobolPic "\<[ZXA]\+\>" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
121 syn match cobolTodo "todo" contained containedin=cobolInlineComment,cobolComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " For MicroFocus or other inline comments, include this line.
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
124 if g:cobol_inline_comment == 1
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
125 syn region cobolInlineComment start="*>" end="$" contains=cobolTodo,cobolMarker
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
126 syn cluster cobolLine add=cobolInlineComment
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
127 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
129 syn match cobolBadLine "[^ D\*$/-].*" contained
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
130
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
131 " If comment mark somehow gets into column past Column 7.
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
132 if g:cobol_inline_comment == 1
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
133 " #C22032019: It is a bad line only if * is not followed by > when inline
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
134 " comments enabled
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
135 syn match cobolBadLine "\s\+\*\(>\)\@!.*" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
136 else
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
137 syn match cobolBadLine "\s\+\*.*" contained
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
138 endif
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
139 syn cluster cobolStart add=cobolBadLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
140
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
141 " #C22032019: Different highlighting for GO TO statements
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
142 " syn keyword cobolGoTo GO GOTO
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
143 syn keyword cobolGoTo GOTO
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
144 syn match cobolGoTo /\<GO\>\s\+\<TO\>/
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
145 syn match cobolGoToPara /\<GO\>\s\+\<TO\>\s\+[A-Z0-9-]\+/ contains=cobolGoTo
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
146 " #C22032019: Highlight copybook name and location in using different group
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
147 " syn keyword cobolCopy COPY
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
148 syn match cobolCopy "\<COPY\>\|\<IN\>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
149 syn match cobolCopy "\<REPLACING\>\s\+\(==\)\@="
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
150 syn match cobolCopy "\<BY\>\s\+\(==\)\@="
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
151 syn match cobolCopyName "\<COPY\>\s\+[A-Z0-9]\+\(\s\+\<IN\>\s\+[A-Z0-9]\+\)\?" contains=cobolCopy
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
152 syn cluster cobolLine add=cobolGoToPara,cobolCopyName
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 " cobolBAD: things that are BAD NEWS!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 syn keyword cobolBAD ALTER ENTER RENAMES
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
157 syn cluster cobolLine add=cobolGoTo,cobolCopy,cobolBAD,cobolWatch,cobolEXECs
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
158
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 " cobolWatch: things that are important when trying to understand a program
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 syn keyword cobolWatch OCCURS DEPENDING VARYING BINARY COMP REDEFINES
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
161 " #C22032019: Remove REPLACING from cobolWatch 'keyword' group and add to cobolCopy &
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
162 " cobolWatch 'match' group
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
163 " syn keyword cobolWatch REPLACING RUN
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
164 syn keyword cobolWatch RUN PROGRAM
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
165 syn match cobolWatch contained "\<REPLACING\>\s\+\(==\)\@!"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
166 " #C22032019: Look for word starting with COMP
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
167 " syn match cobolWatch \"COMP-[123456XN]"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
168 syn match cobolWatch "\<COMP-[123456XN]"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 syn keyword cobolEXECs EXEC END-EXEC
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
173 syn cluster cobolAreaA add=cobolDeclA
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
174 syn cluster cobolAreaAB add=cobolDecl
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
175 syn match cobolDeclA "\(0\=1\|77\|78\) " contained nextgroup=cobolLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
176 syn match cobolDecl "[1-4]\d " contained nextgroup=cobolLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
177 syn match cobolDecl "0\=[2-9] " contained nextgroup=cobolLine
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
178 syn match cobolDecl "66 " contained nextgroup=cobolLine
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
180 syn match cobolWatch "88 " contained nextgroup=cobolLine
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
182 "syn match cobolBadID "\k\+-\($\|[^-A-Z0-9]\)" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
184 syn cluster cobolLine add=cobolCALLs,cobolString,cobolCondFlow
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
185 " #C22032019: Changes for cobolCALLs group to include thru
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
186 " syn keyword cobolCALLs CALL END-CALL CANCEL GOBACK PERFORM END-PERFORM INVOKE
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
187 syn keyword cobolCALLs END-CALL CANCEL GOBACK PERFORM END-PERFORM INVOKE THRU
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
188 " #C22032019: Highlight called program
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
189 " syn match cobolCALLs \"EXIT \+PROGRAM"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
190 syn match cobolCALLs "\<CALL\>"
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
191 syn match cobolCALLProg /\<CALL\>\s\+"\{0,1\}[A-Z0-9]\+"\{0,1\}/ contains=cobolCALLs
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 syn match cobolExtras /\<VALUE \+\d\+\./hs=s+6,he=e-1
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
193 syn cluster cobolLine add=cobolCALLProg
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 syn match cobolString /"[^"]*\("\|$\)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 syn match cobolString /'[^']*\('\|$\)/
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
198 "syn region cobolLine start="^.\{6}[ D-]" end="$" contains=ALL
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
199 syn match cobolIndicator "\%7c[D-]" contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 if exists("cobol_legacy_code")
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
202 syn region cobolCondFlow contains=ALLBUT,cobolLine start="\<\(IF\|INVALID\|END\|EOP\)\>" skip=/\('\|"\)[^"]\{-}\("\|'\|$\)/ end="\." keepend
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 " many legacy sources have junk in columns 1-6: must be before others
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 " Stuff after column 72 is in error - must be after all other "match" entries
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 if exists("cobol_legacy_code")
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 7
diff changeset
208 syn match cobolBadLine "\%73c.*" containedin=ALLBUT,cobolComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 else
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
210 " #C22032019: Use comment highlighting for bad lines
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
211 " syn match cobolBadLine \"\%73c.*" containedin=ALL
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
212 syn match cobolBadLine "\%73c.*" containedin=ALL,cobolInlineComment,cobolComment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 " Define the default highlighting.
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
216 " Only when an item doesn't have highlighting yet
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
218 hi def link cobolBAD Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
219 hi def link cobolBadID Error
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
220 hi def link cobolBadLine Error
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
221 if exists("g:cobol_legacy_code")
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
222 hi def link cobolMarker Comment
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
223 else
10051
46763b01cd9a commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents: 10048
diff changeset
224 hi def link cobolMarker Error
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 6647
diff changeset
225 endif
16086
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
226 hi def link cobolCALLs Function
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
227 hi def link cobolCALLProg Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
228 hi def link cobolComment Comment
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
229 hi def link cobolInlineComment Comment
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
230 hi def link cobolKeys Comment
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
231 hi def link cobolAreaB Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
232 hi def link cobolCompiler PreProc
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
233 hi def link cobolCondFlow Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
234 hi def link cobolCopy PreProc
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
235 hi def link cobolCopyName Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
236 hi def link cobolDeclA cobolDecl
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
237 hi def link cobolDecl Type
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
238 hi def link cobolExtras Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
239 hi def link cobolGoTo Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
240 hi def link cobolGoToPara Function
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
241 hi def link cobolConstant Constant
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
242 hi def link cobolNumber Constant
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
243 hi def link cobolPic Constant
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
244 hi def link cobolReserved Statement
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
245 hi def link cobolDivision Label
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
246 hi def link cobolSection Label
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
247 hi def link cobolParagraph Label
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
248 hi def link cobolDivisionName Keyword
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
249 hi def link cobolSectionName Keyword
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
250 hi def link cobolParagraphName Keyword
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
251 hi def link cobolString Constant
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
252 hi def link cobolTodo Todo
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
253 hi def link cobolWatch Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
254 hi def link cobolIndicator Special
bd7461db24b3 Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10051
diff changeset
255 hi def link cobolStart Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 let b:current_syntax = "cobol"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
259
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 " vim: ts=6 nowrap