Skip to content

Commit cd874c4

Browse files
authored
Support ID Division (#631)
Co-authored-by: hfhbd <[email protected]>
1 parent bc0b568 commit cd874c4

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

psi/src/main/kotlin/app/softwork/kobol/Cobol.bnf

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ program ::= comments idDiv [envDiv] [dataDiv] procedureDiv
3939

4040
comments ::= comment*
4141

42-
idDiv ::= IDENTIFICATION DIVISION DOT programID_clause [other]
42+
idDiv ::= (IDENTIFICATION | ID) DIVISION DOT programID_clause [other]
4343

4444
private other ::= (author_clause | installation_clause | date_clause ) *
4545

psi/src/main/kotlin/app/softwork/kobol/Cobol.flex

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ VARNAME=[a-zA-Z]([\w\-_])*
7171
<YYINITIAL>
7272
{
7373
"IDENTIFICATION" { yybegin(IDENTIFICATION); return CobolTypes.IDENTIFICATION; }
74+
"ID" { yybegin(IDENTIFICATION); return CobolTypes.IDENTIFICATION; }
7475
"ENVIRONMENT" { yybegin(ENVIRONMENT); return CobolTypes.ENVIRONMENT; }
7576
"DATA" { yybegin(DATA); return CobolTypes.DATA; }
7677
"PROCEDURE" { yybegin(PROCEDURE); return CobolTypes.PROCEDURE; }

psi/src/test/kotlin/app/softwork/kobol/CobolLexerTest.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CobolLexerTest {
1313
fun author() {
1414
assertEquals(
1515
"""
16-
123456 IDENTIFICATION DIVISION.
16+
123456 ID DIVISION.
1717
123456 PROGRAM-ID. BS12A00.
1818
123456 AUTHOR. A.
1919
123456 PROCEDURE DIVISION.

0 commit comments

Comments
 (0)