Skip to content

Commit 5fdd7cb

Browse files
Bugfix about PERFROM UNTIL (#544)
1 parent 9b11bb2 commit 5fdd7cb

File tree

6 files changed

+35
-4
lines changed

6 files changed

+35
-4
lines changed

cobj/codegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ static void joutput_cond(cb_tree x, int save_flag) {
19731973
}
19741974
joutput_indent("(new GetInt() {");
19751975
joutput_indent_level += 2;
1976-
joutput_indent("public int run(){");
1976+
joutput_indent("public int run() throws CobolStopRunException {");
19771977
joutput_indent_level += 2;
19781978
for (; x; x = CB_CHAIN(x)) {
19791979
// 最後の文ならreturn文を書く

libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/common/GetInt.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
*/
1919
package jp.osscons.opensourcecobol.libcobj.common;
2020

21+
import jp.osscons.opensourcecobol.libcobj.exceptions.CobolStopRunException;
22+
2123
/** TODO: 準備中 */
2224
public interface GetInt {
2325
/**
2426
* TODO: 準備中
2527
*
2628
* @return TODO: 準備中
29+
* @throws CobolStopRunException TODO: 準備中
2730
*/
28-
int run();
31+
int run() throws CobolStopRunException;
2932
}

tests/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ misc_DEPENDENCIES = \
220220
misc.src/japanese-char-section-var.at \
221221
misc.src/evaluate-switch.at \
222222
misc.src/fserial-variable.at \
223-
misc.src/file-handler-japanese.at
223+
misc.src/file-handler-japanese.at \
224+
misc.src/perform-until-div.at
224225

225226
EXTRA_DIST = $(srcdir)/package.m4 \
226227
$(TESTS) \

tests/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ misc_DEPENDENCIES = \
759759
misc.src/japanese-char-section-var.at \
760760
misc.src/evaluate-switch.at \
761761
misc.src/fserial-variable.at \
762-
misc.src/file-handler-japanese.at
762+
misc.src/file-handler-japanese.at \
763+
misc.src/perform-until-div.at
763764

764765
EXTRA_DIST = $(srcdir)/package.m4 \
765766
$(TESTS) \

tests/misc.at

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ m4_include([japanese-char-section-var.at])
5050
m4_include([evaluate-switch.at])
5151
m4_include([fserial-variable.at])
5252
m4_include([file-handler-japanese.at])
53+
m4_include([perform-until-div.at])
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
AT_SETUP([PERFORM UNTIL whose condition contains division])
2+
3+
AT_DATA([prog.cbl], [
4+
IDENTIFICATION DIVISION.
5+
PROGRAM-ID. prog.
6+
DATA DIVISION.
7+
WORKING-STORAGE SECTION.
8+
01 CNT PIC 9(4) VALUE 1000.
9+
01 I PIC 9(4) VALUE 1.
10+
PROCEDURE DIVISION.
11+
MAIN.
12+
PERFORM
13+
VARYING I
14+
FROM 1 BY 1
15+
UNTIL I > (CNT + 743) / 744
16+
PERFORM SUB
17+
END-PERFORM
18+
STOP RUN.
19+
SUB.
20+
DISPLAY "HELLO".
21+
])
22+
23+
AT_CHECK([${COBJ} prog.cbl])
24+
25+
AT_CLEANUP

0 commit comments

Comments
 (0)