Skip to content

Commit 0efe35b

Browse files
authored
Merge pull request #2513 from TypeCobolTeam/v1.6.2
v1.6.2
2 parents ba01479 + 800e4fc commit 0efe35b

File tree

21 files changed

+1174
-758
lines changed

21 files changed

+1174
-758
lines changed

TypeCobol.LanguageServer.Test/LSRTests/GlobalStorageCompletion/input/GlobalStorageCompletion.tlsp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"category": 1,
26-
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/COLLARBE/AppData/Local/Temp/tcbl/PROCCALL580149467693110299.cee\",\"diagnostics\":[{\"range\":{\"start\":{\"line\":26,\"character\":12},\"end\":{\"line\":26,\"character\":18}},\"severity\":1,\"code\":\"27\",\"source\":\"Find the syntax diagram describing the statement in error in the language reference\",\"message\":\"Syntax error : mismatched input 'DECLARE' expecting {symbol, special register, keyword}\"},{\"range\":{\"start\":{\"line\":26,\"character\":12},\"end\":{\"line\":28,\"character\":17}},\"severity\":1,\"code\":\"27\",\"source\":\"Find the syntax diagram describing the statement in error in the language reference\",\"message\":\"Syntax error : extraneous input 'DECLAREPROCEDUREMyTestProcPRIVATEINPUTParam1TYPEBool.' expecting {SentenceEnd, AcceptStatement, AddStatement, AllocateStatement, AlterStatement, CallStatement, CancelStatement, CloseStatement, ComputeStatement, ContinueStatement, DeleteStatement, DisplayStatement, DivideStatement, EntryStatement, EvaluateStatement, ExecStatement, ExitMethodStatement, ExitParagraphStatement, ExitPerformStatement, ExitProgramStatement, ExitSectionStatement, ExitStatement, FreeStatement, GobackStatement, GotoStatement, IfStatement, InitializeStatement, InspectStatement, InvokeStatement, JsonGenerateStatement, JsonParseStatement, MergeStatement, MoveStatement, MultiplyStatement, OpenStatement, PerformProcedureStatement, PerformStatement, ReadStatement, ReleaseStatement, ReturnStatement, RewriteStatement, SearchStatement, SetStatement, SortStatement, StartStatement, StopStatement, StringStatement, SubtractStatement, UnstringStatement, WriteStatement, XmlGenerateStatement, XmlParseStatement, AtEndCondition, NotAtEndCondition, OnExceptionCondition, NotOnExceptionCondition, OnOverflowCondition, NotOnOverflowCondition, InvalidKeyCondition, NotInvalidKeyCondition, OnSizeErrorCondition, NotOnSizeErrorCondition, ElseCondition, WhenCondition, WhenOtherCondition, AddStatementEnd, CallStatementEnd, ComputeStatementEnd, DeleteStatementEnd, DivideStatementEnd, EvaluateStatementEnd, IfStatementEnd, InvokeStatementEnd, JsonStatementEnd, MultiplyStatementEnd, PerformStatementEnd, ReadStatementEnd, ReturnStatementEnd, RewriteStatementEnd, SearchStatementEnd, StartStatementEnd, StringStatementEnd, SubtractStatementEnd, UnstringStatementEnd, WriteStatementEnd, XmlStatementEnd, ProcedureStyleCall}\"}]}}"
26+
"message": "{\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"uri\":\"file:///C:/Users/COLLARBE/AppData/Local/Temp/tcbl/PROCCALL580149467693110299.cee\",\"diagnostics\":[{\"range\":{\"start\":{\"line\":26,\"character\":12},\"end\":{\"line\":26,\"character\":18}},\"severity\":1,\"code\":\"27\",\"source\":\"Find the syntax diagram describing the statement in error in the language reference\",\"message\":\"Syntax error : mismatched input 'DECLARE' expecting {symbol, special register, keyword}\"},{\"range\":{\"start\":{\"line\":26,\"character\":12},\"end\":{\"line\":28,\"character\":17}},\"severity\":1,\"code\":\"27\",\"source\":\"Find the syntax diagram describing the statement in error in the language reference\",\"message\":\"Syntax error : Sentence is not correctly ended: a period was required.\"}]}}"
2727
},
2828
{
2929
"category": 2,

TypeCobol.LanguageServer.Test/LSRTests/ProcedureCompletionCaseInsensitive/input/ProcedureCompletionCaseInsensitive.tlsp

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

TypeCobol.LanguageServer.Test/LSRTests/ProcedureCompletionPotentialChildrenWithNoName/input/ProcedureCompletionPotentialChildrenWithNoName.tlsp

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

TypeCobol.Test/Parser/Incremental/BasicEdits/ParagraphAndPERFORM.2_AddStatement.Nodes.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Line 9[8,26] <27, Error, Syntax> - Syntax error : extraneous input 'ENDPROGRAMSimple.' expecting {SentenceEnd, AcceptStatement, AddStatement, AllocateStatement, AlterStatement, CallStatement, CancelStatement, CloseStatement, ComputeStatement, ContinueStatement, DeleteStatement, DisplayStatement, DivideStatement, EntryStatement, EvaluateStatement, ExecStatement, ExitMethodStatement, ExitParagraphStatement, ExitPerformStatement, ExitProgramStatement, ExitSectionStatement, ExitStatement, FreeStatement, GobackStatement, GotoStatement, IfStatement, InitializeStatement, InspectStatement, InvokeStatement, JsonGenerateStatement, JsonParseStatement, MergeStatement, MoveStatement, MultiplyStatement, OpenStatement, PerformProcedureStatement, PerformStatement, ReadStatement, ReleaseStatement, ReturnStatement, RewriteStatement, SearchStatement, SetStatement, SortStatement, StartStatement, StopStatement, StringStatement, SubtractStatement, UnstringStatement, WriteStatement, XmlGenerateStatement, XmlParseStatement, AtEndCondition, NotAtEndCondition, OnExceptionCondition, NotOnExceptionCondition, OnOverflowCondition, NotOnOverflowCondition, InvalidKeyCondition, NotInvalidKeyCondition, OnSizeErrorCondition, NotOnSizeErrorCondition, ElseCondition, WhenCondition, WhenOtherCondition, AddStatementEnd, CallStatementEnd, ComputeStatementEnd, DeleteStatementEnd, DivideStatementEnd, EvaluateStatementEnd, IfStatementEnd, InvokeStatementEnd, JsonStatementEnd, MultiplyStatementEnd, PerformStatementEnd, ReadStatementEnd, ReturnStatementEnd, RewriteStatementEnd, SearchStatementEnd, StartStatementEnd, StringStatementEnd, SubtractStatementEnd, UnstringStatementEnd, WriteStatementEnd, XmlStatementEnd, ProcedureStyleCall}
1+
Line 9[8,26] <27, Error, Syntax> - Syntax error : Sentence is not correctly ended: a period was required.
22
--- Nodes ---
33
?
44
Simple
@@ -9,6 +9,8 @@ Line 9[8,26] <27, Error, Syntax> - Syntax error : extraneous input 'ENDPROGRAMSi
99

1010
end
1111
a
12-
[[DisplayStatement]] [12,18:DISPLAY]<DISPLAY> --> [20,22+:"a"]<AlphanumericLiteral>(",Y,Y){a}
12+
sentence-0
13+
[[DisplayStatement]] [12,18:DISPLAY]<DISPLAY> --> [20,22+:"a"]<AlphanumericLiteral>(",Y,Y){a}
1314
- variables = "a"
1415

16+
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Line 16[8,10] <27, Error, Syntax> - Syntax error : no viable alternative at input 'set ... end'
2+
Line 13[12,28] <37, Warning, General> - Warning: "end-if" is missing
3+
Line 16[8,27] <27, Error, Syntax> - Syntax error : Sentence is not correctly ended: a period was required.
4+
--- Nodes ---
5+
?
6+
MainPgm
7+
procedure-division
8+
Nested1
9+
data-division
10+
local-storage
11+
Var1
12+
procedure-division
13+
sentence-0
14+
[[IfStatement]] [12,13:if]<IF> --> [28,28:)]<RightParenthesisSeparator>
15+
16+
?
17+
[[SetStatement]] [17,19:set]<SET> --> [17,19:set]<SET>
18+
19+
end
20+
Nested2
21+
procedure-division
22+
sentence-0
23+
[[GobackStatement]] [12,17:goback]<GOBACK> --> [12,17:goback]<GOBACK>
24+
25+
end
26+
end
27+
Nested3
28+
end
29+
end
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
IDENTIFICATION DIVISION.
2+
PROGRAM-ID. MainPgm.
3+
procedure division.
4+
5+
6+
IDENTIFICATION DIVISION.
7+
PROGRAM-ID. Nested1.
8+
data division.
9+
local-storage section.
10+
01 Var1 pic X.
11+
12+
procedure division.
13+
if ( Var1 = "A" )
14+
set
15+
16+
end program Nested1.
17+
18+
19+
IDENTIFICATION DIVISION.
20+
PROGRAM-ID. Nested2.
21+
procedure division.
22+
goback
23+
.
24+
end program Nested2.
25+
26+
27+
IDENTIFICATION DIVISION.
28+
PROGRAM-ID. Nested3.
29+
30+
END PROGRAM Nested3.
31+
32+
END PROGRAM MainPgm.

TypeCobol.Test/Parser/Programs/Cobol85/MissingSentenceEnd.PGM.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
--- Diagnostics ---
22
Line 4[6,6] <30, Error, Semantics> - Semantic error: Symbol a is not referenced OffendingSymbol=[6,6:a]<UserDefinedWord>
33
Line 4[11,11] <30, Error, Semantics> - Semantic error: Symbol b is not referenced OffendingSymbol=[11,11:b]<UserDefinedWord>
4-
Line 5[1,32] <27, Error, Syntax> - Syntax error : extraneous input 'EndProgramMissingSentenceEnd. ' expecting {SentenceEnd, AcceptStatement, AddStatement, AllocateStatement, AlterStatement, CallStatement, CancelStatement, CloseStatement, ComputeStatement, ContinueStatement, DeleteStatement, DisplayStatement, DivideStatement, EntryStatement, EvaluateStatement, ExecStatement, ExitMethodStatement, ExitParagraphStatement, ExitPerformStatement, ExitProgramStatement, ExitSectionStatement, ExitStatement, FreeStatement, GobackStatement, GotoStatement, IfStatement, InitializeStatement, InspectStatement, InvokeStatement, JsonGenerateStatement, JsonParseStatement, MergeStatement, MoveStatement, MultiplyStatement, OpenStatement, PerformProcedureStatement, PerformStatement, ReadStatement, ReleaseStatement, ReturnStatement, RewriteStatement, SearchStatement, SetStatement, SortStatement, StartStatement, StopStatement, StringStatement, SubtractStatement, UnstringStatement, WriteStatement, XmlGenerateStatement, XmlParseStatement, AtEndCondition, NotAtEndCondition, OnExceptionCondition, NotOnExceptionCondition, OnOverflowCondition, NotOnOverflowCondition, InvalidKeyCondition, NotInvalidKeyCondition, OnSizeErrorCondition, NotOnSizeErrorCondition, ElseCondition, WhenCondition, WhenOtherCondition, AddStatementEnd, CallStatementEnd, ComputeStatementEnd, DeleteStatementEnd, DivideStatementEnd, EvaluateStatementEnd, IfStatementEnd, InvokeStatementEnd, JsonStatementEnd, MultiplyStatementEnd, PerformStatementEnd, ReadStatementEnd, ReturnStatementEnd, RewriteStatementEnd, SearchStatementEnd, StartStatementEnd, StringStatementEnd, SubtractStatementEnd, UnstringStatementEnd, WriteStatementEnd, XmlStatementEnd, ProcedureStyleCall} OffendingSymbol=[[ProgramEnd]] [1,3:End]<END> --> [31,32:. ]<PeriodSeparator>
5-
- ProgramName = MissingSentenceEnd
6-
4+
Line 5[1,32] <27, Error, Syntax> - Syntax error : Sentence is not correctly ended: a period was required.
75

86
--- Program ---
97
PROGRAM: MissingSentenceEnd common:False initial:False recursive:False
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
IDENTIFICATION DIVISION.
2+
PROGRAM-ID. ReplaceCheckAllowedCharacters.
3+
DATA DIVISION.
4+
working-storage section.
5+
6+
01 Group1.
7+
replace ==:_:== by ==OK1-UNDERSCORE==.
8+
05 :_:-Var pic X.
9+
replace ==:>:== by ==OK2-GREATER==.
10+
05 :>:-Var pic X.
11+
replace ==:=:== by ==OK3-EQUAL==.
12+
05 :=:-Var pic X.
13+
replace ==:<:== by ==OK4-LESS==.
14+
05 :<:-Var pic X.
15+
replace ==:;:== by ==OK5-SEMICOLON==.
16+
05 :;:-Var pic X.
17+
replace ==:/:== by ==OK6-SLASH==.
18+
05 :/:-Var pic X.
19+
replace ==:.:== by ==OK7-DOT==.
20+
05 :.:-Var pic X.
21+
replace ==:-:== by ==OK8-HYPHEN==.
22+
05 :-:-Var pic X.
23+
replace ==:,:== by ==OK9-COLON==.
24+
05 :,:-Var pic X.
25+
replace ==:+:== by ==OK10-PLUS==.
26+
05 :+:-Var pic X.
27+
replace ==:*:== by ==OK11-STAR==.
28+
05 :*:-Var pic X.
29+
replace ==:$:== by ==OK12-DOLLAR==.
30+
05 :$:-Var pic X.
31+
replace ==: :== by ==OK13-SPACE==.
32+
05 : :-Var pic X.
33+
34+
*Ok
35+
replace ==:'':== by ==OK14-2-QUOTE==.
36+
05 :'':-Var pic X.
37+
*Ok
38+
replace ==:"":== by ==OK15-2-DOUBLEQUOTE==.
39+
05 :"":-Var pic X.
40+
41+
*Ok for CobolEditorE-I
42+
*But NOT OK in IBM because string is not terminated correctly ?
43+
*An invalid"REPLACE"statement was found. Scanning was resumed at
44+
* the period terminating the"REPLACE"statement.
45+
replace ==:':== by ==OK16-QUOTE==.
46+
05 :':-Var pic X.
47+
*Ok for CobolEditorE-I
48+
*But NOT OK because string is not terminated correctly ?
49+
*An invalid"REPLACE"statement was found. Scanning was resumed at
50+
* the period terminating the"REPLACE"statement.
51+
replace ==:":== by ==OK17-DOUBLE-QUOTE==.
52+
05 :":-Var pic X.
53+
54+
*KO for CobolEditorE-I
55+
replace ==:):== by ==KO-OPEN-PARENTHESIS==.
56+
Line 56[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
57+
Line 56[28,28] <27, Error, Syntax> - Syntax error : extraneous input '.' expecting {ProgramIdentification, ProgramEnd, ClassIdentification, ClassEnd, FactoryEnd, ObjectIdentification, ObjectEnd, MethodEnd, ProcedureDivisionHeader, WorkingStorageSectionHeader, LocalStorageSectionHeader, LinkageSectionHeader, FileDescriptionEntry, DataDescriptionEntry, DataRedefinesEntry, DataRenamesEntry, DataConditionEntry, ExecStatement, FunctionDeclarationEnd, GlobalStorageSectionHeader}
58+
05 :):-Var pic X.
59+
replace ==:(:== by ==KO-CLOSE-PARENTHESIS==.
60+
Line 58[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
61+
05 :(:-Var pic X.
62+
63+
64+
*Non-COBOL character"@"was found in column 19.
65+
* The character was accepted.
66+
Line 63[18,18] <55, Error, Tokens> - Non-COBOL character "@" was found in column 19.
67+
replace ==:@:== by ==KO-AROBASE==.
68+
*Non-COBOL character(s) were found starting with"@"in column 16.
69+
* The characters were discarded.
70+
Line 66[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
71+
05 :@:-Var pic X.
72+
73+
74+
*Ko Non-COBOL character"€"was found in column 19.
75+
*The character was accepted.
76+
Line 71[18,18] <55, Error, Tokens> - Non-COBOL character "€" was found in column 19.
77+
replace ==:€:== by ==KO-EURO==.
78+
Line 72[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
79+
05 :€:-Var pic X.
80+
81+
*Ko Non-COBOL character"£"was found in column 19.
82+
*The character was accepted.
83+
Line 76[18,18] <55, Error, Tokens> - Non-COBOL character "£" was found in column 19.
84+
replace ==:£:== by ==KO-GBR==.
85+
Line 77[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
86+
05 :£:-Var pic X.
87+
88+
*Ko Non-COBOL character"#"was found in column 19.
89+
*The character was accepted.
90+
Line 81[18,18] <55, Error, Tokens> - Non-COBOL character "#" was found in column 19.
91+
replace ==:#:== by ==KO-SHARP==.
92+
Line 82[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
93+
05 :#:-Var pic X.
94+
95+
*Ko Non-COBOL character"é"was found in column 19.
96+
*The character was accepted.
97+
Line 86[18,18] <55, Error, Tokens> - Non-COBOL character "é" was found in column 19.
98+
replace ==:é:== by ==KO-E-ACUTE==.
99+
Line 87[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
100+
05 :é:-Var pic X.
101+
102+
*Ko Non-COBOL character"&"was found in column 19.
103+
*The character was accepted.
104+
Line 91[18,18] <55, Error, Tokens> - Non-COBOL character "&" was found in column 19.
105+
replace ==:&:== by ==KO-AND==.
106+
Line 92[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
107+
05 :&:-Var pic X.
108+
109+
*Ko Non-COBOL character"["was found in column 19.
110+
*The character was accepted.
111+
Line 96[18,18] <55, Error, Tokens> - Non-COBOL character "[" was found in column 19.
112+
replace ==:[:== by ==KO-OPEN-BRACKET==.
113+
Line 97[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
114+
05 :[:-Var pic X.
115+
*Ko Non-COBOL character"]"was found in column 19.
116+
*The character was accepted.
117+
Line 100[18,18] <55, Error, Tokens> - Non-COBOL character "]" was found in column 19.
118+
replace ==:]:== by ==KO-CLOSE-BRACKET==.
119+
Line 101[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
120+
05 :]:-Var pic X.
121+
*Ko Non-COBOL character"^"was found in column 19.
122+
*The character was accepted.
123+
Line 104[18,18] <55, Error, Tokens> - Non-COBOL character "^" was found in column 19.
124+
replace ==:^:== by ==KO-CIRCUMFLEX ==.
125+
Line 105[19,19] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
126+
05 :^ :-Var pic X.
127+
*Ko Non-COBOL character"{"was found in column 19.
128+
*The character was accepted.
129+
Line 108[18,18] <55, Error, Tokens> - Non-COBOL character "{" was found in column 19.
130+
replace ==:{:== by ==KO-OPEN-BRACE==.
131+
Line 109[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
132+
05 :{:-Var pic X.
133+
*Ko Non-COBOL character"}"was found in column 19.
134+
*The character was accepted.
135+
Line 112[18,18] <55, Error, Tokens> - Non-COBOL character "}" was found in column 19.
136+
replace ==:}:== by ==KO-CLOSE-BRACE==.
137+
Line 113[18,18] <27, Error, Syntax> - Syntax error : no viable alternative at input '05 ... -'
138+
05 :}:-Var pic X.
139+
140+
END PROGRAM ReplaceCheckAllowedCharacters.

0 commit comments

Comments
 (0)