Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2667,6 +2667,7 @@ static void joutput_search_all(cb_tree table, cb_tree stmt, cb_tree cond,
joutput_prefix();
joutput("int tail = ");
if (p->occurs_depending) {
joutput("(int)");
joutput_integer(p->occurs_depending);
joutput(" + 1;\n");
} else {
Expand Down
6 changes: 3 additions & 3 deletions cobj/pplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ typedef unsigned int flex_uint32_t;
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START (((yy_start)-1) / 2)
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
Expand Down Expand Up @@ -2632,8 +2632,8 @@ YY_DECL {
default:
YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of scanning one token */
} /* end of user's declarations */
} /* end of yylex */

/* yy_get_next_buffer - try to read in a new buffer
Expand Down
3 changes: 2 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ misc_DEPENDENCIES = \
misc.src/evaluate-switch.at \
misc.src/fserial-variable.at \
misc.src/file-handler-japanese.at \
misc.src/perform-until-div.at
misc.src/perform-until-div.at \
misc.src/search-occurs-depending.at

EXTRA_DIST = $(srcdir)/package.m4 \
$(TESTS) \
Expand Down
3 changes: 2 additions & 1 deletion tests/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,8 @@ misc_DEPENDENCIES = \
misc.src/evaluate-switch.at \
misc.src/fserial-variable.at \
misc.src/file-handler-japanese.at \
misc.src/perform-until-div.at
misc.src/perform-until-div.at \
misc.src/search-occurs-depending.at

EXTRA_DIST = $(srcdir)/package.m4 \
$(TESTS) \
Expand Down
1 change: 1 addition & 0 deletions tests/misc.at
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ m4_include([evaluate-switch.at])
m4_include([fserial-variable.at])
m4_include([file-handler-japanese.at])
m4_include([perform-until-div.at])
m4_include([search-occurs-depending.at])
32 changes: 32 additions & 0 deletions tests/misc.src/search-occurs-depending.at
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
AT_SETUP([SEARCH OCCURS DEPENDING])

AT_DATA([prog.cbl], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 AAA.
02 AAA1 PIC X(04) VALUE "HOGE".
02 FILLER PIC X(18) VALUE SPACE.
02 AAA2 PIC S9(4) COMP.
01 BBB.
02 AAA-1 OCCURS 1 TO 11 DEPENDING ON AAA2
ASCENDING KEY KEY-A INDEXED BY K1.
03 KEY-A PIC X(05).
03 BBB1 PIC X(05).
03 FILLER PIC X(02).
01 CCC PIC X(05).
PROCEDURE DIVISION.
SEARCH ALL AAA-1
AT END
MOVE "ERROR" TO CCC
WHEN KEY-A (K1) = "00001"
MOVE BBB1 (K1) TO CCC
END-SEARCH.
DISPLAY CCC.
STOP RUN.
])

AT_CHECK([${COBJ} prog.cbl], [0])

AT_CLEANUP