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
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [1.1.5] - 2024-12-27

### Add

* Convert string literals containing SJIS characters to Java string literals. (#561)
* The older versions convert string literals containing SJIS characters into byte arrays with hexdecimal integers.
* Older versions convert `"日本語"` into `CobolUtil.toBytes((byte)0x93, (byte)0xfa, (byte)0x96, (byte)0x7b, (byte)0x8c, (byte)0xea)`.
* Latest version converts `"日本語"` to `CobolUtil.stringToBytes("日本語")`.

### Fix

* Fix comparisons of COMP data. (#559)
* With older versions, comparisons of COMP data are invalid in some cases.

## [1.1.4] - 2024-11-29

### Fix
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024-12-27 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.1.5 released.

2024-11-29 OSS Consortium <ws-opensource-cobol-contact@osscons.jp>

* opensource COBOL 4J v1.1.4 released.
Expand Down
14 changes: 14 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@ NEWS - user visible changes -*- outline -*-

-----------------------------------------------------------------------

** New Features

(1) Convert string literals containing SJIS characters to Java string literals. (#561)
* The older versions convert string literals containing SJIS characters into byte arrays with hexdecimal integers.
* Older versions convert `"日本語"` into `CobolUtil.toBytes((byte)0x93, (byte)0xfa, (byte)0x96, (byte)0x7b, (byte)0x8c, (byte)0xea)`.
* Latest version converts `"日本語"` to `CobolUtil.stringToBytes("日本語")`.

** Bug Fixes

(1) Fix comparisons of COMP data.
* With older versions, comparisons of COMP data are invalid in some cases.

-----------------------------------------------------------------------

* opensource COBOL 4J 1.1.4

*** Bug Fixes
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ dnf install -y java-21-amazon-corretto-devel gcc make bison flex automake autoco

### Install opensource COBOL 4J
```
curl -L -o opensourcecobol4j-v1.1.4.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.4.tar.gz
tar zxvf opensourcecobol4j-v1.1.4.tar.gz
cd opensourcecobol4j-1.1.4
curl -L -o opensourcecobol4j-v1.1.5.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.5.tar.gz
tar zxvf opensourcecobol4j-v1.1.5.tar.gz
cd opensourcecobol4j-1.1.5
./configure --prefix=/usr/
make
sudo make install
Expand Down Expand Up @@ -125,7 +125,7 @@ https://www.oracle.com/java/technologies/downloads/?er=221886#java8-windows
The docker container for opensource COBOL 4J is available.

```bash
docker pull opensourcecobol/opensourcecobol4j:1.1.4
docker pull opensourcecobol/opensourcecobol4j:1.1.5
```

Execute the following commands in order to run the "Hello World" COBOL program.
Expand Down
8 changes: 4 additions & 4 deletions README_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ dnf install -y java-21-amazon-corretto-devel gcc make bison flex automake autoco

### opensource COBOL 4Jのインストール
```
curl -L -o opensourcecobol4j-v1.1.4.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.4.tar.gz
tar zxvf opensourcecobol4j-v1.1.4.tar.gz
cd opensourcecobol4j-1.1.4
curl -L -o opensourcecobol4j-v1.1.5.tar.gz https://github.com/opensourcecobol/opensourcecobol4j/archive/refs/tags/v1.1.5.tar.gz
tar zxvf opensourcecobol4j-v1.1.5.tar.gz
cd opensourcecobol4j-1.1.5
./configure --prefix=/usr/
make
sudo make install
Expand Down Expand Up @@ -114,7 +114,7 @@ Windows版のopensource COBOL 4JはVisual Studioに含まれるCLコンパイラ
opensource COBOL 4JのDockerコンテナを利用できます。

```bash
docker pull opensourcecobol/opensourcecobol4j:1.1.4
docker pull opensourcecobol/opensourcecobol4j:1.1.5
```

以下のコマンドを実行して、"Hello World"のCOBOLプログラムを実行します。
Expand Down
24 changes: 11 additions & 13 deletions ReleaseNote.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
### Fixed
* Process Japanese identifiers in COBOL correctly.
* The older versions convert some Japanese characters in COBOL identifiers to another characters in Java.
* Fix the conditions `PERFORM UNTIL`.
* If COBOL source code contains divisions in conditions of `PERFORM UNTIL`, the older versions emit compile errors.
* Fix `SEARCH` statements with data specified `OCCURS` and `DEPENDING`.
* The older versions emit compile errors when `SEARCH` statements with data specified `OCCURS` and `DEPENDING`
* Fix `ADD` statements and `SUBTRACT` statements.
* In some case, the result of `SUBTRACT` was previously incorrect when the operands contais PIC S9(n) negative values.
* In some case, the result of `ADD` was -0 instead of +0 previously.
* Fix the process of checking signs of PIC 9(n) containing spaces.
* Fix `INSPECT` statements.
* The older versions change signs of some values accidentally because of the bug of `INSPECT` statements.
### Add

* Convert string literals containing SJIS characters to Java string literals.
* The older versions convert string literals containing SJIS characters into byte arrays with hexdecimal integers.
* Older versions convert `"日本語"` into `CobolUtil.toBytes((byte)0x93, (byte)0xfa, (byte)0x96, (byte)0x7b, (byte)0x8c, (byte)0xea)`.
* Latest version converts `"日本語"` to `CobolUtil.stringToBytes("日本語")`.

### Fix

* Fix comparisons of COMP data.
* With older versions, comparisons of COMP data are invalid in some cases.
3 changes: 2 additions & 1 deletion cobj/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ static void joutput_string_write(const unsigned char *s, int size,
enum cb_string_category category) {
int i;

if (category == CB_STRING_CATEGORY_ALL_ASCII) {
if (category == CB_STRING_CATEGORY_ALL_ASCII ||
category == CB_STRING_CATEGORY_ALL_SJIS) {
if (param_wrap_string_flag) {
joutput("new CobolDataStorage(");
} else {
Expand Down
26 changes: 13 additions & 13 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for opensource COBOL 4J 1.1.4.
# Generated by GNU Autoconf 2.69 for opensource COBOL 4J 1.1.5.
#
# Report bugs to <ws-opensource-cobol-contact@osscons.jp>.
#
Expand Down Expand Up @@ -589,9 +589,9 @@ MAKEFLAGS=

# Identity of this package.
PACKAGE_NAME='opensource COBOL 4J'
PACKAGE_TARNAME='opensource-cobol-4j-1.1.4'
PACKAGE_VERSION='1.1.4'
PACKAGE_STRING='opensource COBOL 4J 1.1.4'
PACKAGE_TARNAME='opensource-cobol-4j-1.1.5'
PACKAGE_VERSION='1.1.5'
PACKAGE_STRING='opensource COBOL 4J 1.1.5'
PACKAGE_BUGREPORT='ws-opensource-cobol-contact@osscons.jp'
PACKAGE_URL=''

Expand Down Expand Up @@ -1382,7 +1382,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures opensource COBOL 4J 1.1.4 to adapt to many kinds of systems.
\`configure' configures opensource COBOL 4J 1.1.5 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1432,7 +1432,7 @@ Fine tuning of the installation directories:
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
[DATAROOTDIR/doc/opensource-cobol-4j-1.1.4]
[DATAROOTDIR/doc/opensource-cobol-4j-1.1.5]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
Expand All @@ -1454,7 +1454,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of opensource COBOL 4J 1.1.4:";;
short | recursive ) echo "Configuration of opensource COBOL 4J 1.1.5:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1581,7 +1581,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opensource COBOL 4J configure 1.1.4
opensource COBOL 4J configure 1.1.5
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2133,7 +2133,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by opensource COBOL 4J $as_me 1.1.4, which was
It was created by opensource COBOL 4J $as_me 1.1.5, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -3024,8 +3024,8 @@ fi


# Define the identity of the package.
PACKAGE='opensource-cobol-4j-1.1.4'
VERSION='1.1.4'
PACKAGE='opensource-cobol-4j-1.1.5'
VERSION='1.1.5'


cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -23446,7 +23446,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by opensource COBOL 4J $as_me 1.1.4, which was
This file was extended by opensource COBOL 4J $as_me 1.1.5, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -23512,7 +23512,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
opensource COBOL 4J config.status 1.1.4
opensource COBOL 4J config.status 1.1.5
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

AC_PREREQ(2.59)

AC_INIT([opensource COBOL 4J],[1.1.4],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.1.4])
AC_INIT([opensource COBOL 4J],[1.1.5],[ws-opensource-cobol-contact@osscons.jp],[opensource-cobol-4j-1.1.5])
AC_CONFIG_SRCDIR([libcobj.h])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_TESTDIR([tests])
Expand Down
2 changes: 1 addition & 1 deletion libcobj/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ publishing {
register<MavenPublication>("gpr") {
groupId = "jp.osscons.opensourcecobol"
artifactId = "libcobj"
version = "1.1.4"
version = "1.1.5"
from(components["java"])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
public class Const {

/** TODO: 準備中 */
public static final String version = "1.1.4";
public static final String version = "1.1.5";
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void getOptions(String[] args) {
System.exit(0);
break;
case "v":
System.out.println("1.1.4");
System.out.println("1.1.5");
System.exit(0);
break;
case "java-package":
Expand Down
8 changes: 4 additions & 4 deletions tests/command-line-options.src/info-java-dir.at
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AT_DATA([prog.cbl], [
AT_CHECK([${COBJ} -info-json-dir=./ callee.cbl prog.cbl])
AT_CHECK([cat info_callee.json], [0],
[{
"opensourcecobol4j_version": "1.1.4",
"opensourcecobol4j_version": "1.1.5",
"program_id": "callee",
"procedure_division_using_parameters": @<:@
{
Expand All @@ -45,7 +45,7 @@ AT_CHECK([cat info_callee.json], [0],

AT_CHECK([cat info_prog.json], [0],
[{
"opensourcecobol4j_version": "1.1.4",
"opensourcecobol4j_version": "1.1.5",
"program_id": "prog",
"procedure_division_using_parameters": @<:@
@:>@
Expand All @@ -64,7 +64,7 @@ AT_CHECK([${COBJ} -info-json-dir=bbb callee.cbl prog.cbl])

AT_CHECK([cat bbb/info_callee.json], [0],
[{
"opensourcecobol4j_version": "1.1.4",
"opensourcecobol4j_version": "1.1.5",
"program_id": "callee",
"procedure_division_using_parameters": @<:@
{
Expand All @@ -81,7 +81,7 @@ AT_CHECK([cat bbb/info_callee.json], [0],

AT_CHECK([cat bbb/info_prog.json], [0],
[{
"opensourcecobol4j_version": "1.1.4",
"opensourcecobol4j_version": "1.1.5",
"program_id": "prog",
"procedure_division_using_parameters": @<:@
@:>@
Expand Down
59 changes: 59 additions & 0 deletions tests/i18n_sjis.src/pic-x.at
Original file line number Diff line number Diff line change
Expand Up @@ -483,3 +483,62 @@ AT_CHECK([cobj prog.cob], [0])
AT_CHECK([java prog], [0], [02])

AT_CLEANUP

AT_SETUP([Readable string literals])
# Older compilers converts string literals "“ú–{Œê" in COBOL source code
# to `CobolUtil.toBytes((byte)0x93, (byte)0xfa, (byte)0x96, (byte)0x7b, (byte)0x8c, (byte)0xea)` in Java source code.
# The following tests check that the compiler converts the string literals to readable ones.

AT_DATA([prog1.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 F0 PIC X(30) VALUE "“Œ‹ž1".
PROCEDURE DIVISION.
MOVE "“Œ‹ž2" TO F0.
DISPLAY "“Œ‹ž3".
])

AT_CHECK([cobj prog1.cob])
AT_CHECK([grep '“Œ‹ž1' < prog1.java > /dev/null])
AT_CHECK([grep '“Œ‹ž2' < prog1.java > /dev/null])
AT_CHECK([grep '“Œ‹ž3' < prog1.java > /dev/null])

# '@' is the first multi-byte Shift-JIS character with respect to the byte order
# see http://charset.7jp.net/sjis.html
AT_DATA([prog2.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog2.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 F0 PIC X(30) VALUE "@1".
PROCEDURE DIVISION.
MOVE "@2" TO F0.
DISPLAY "@3".
])

AT_CHECK([cobj prog2.cob])
AT_CHECK([grep '@1' < prog2.java > /dev/null])
AT_CHECK([grep '@2' < prog2.java > /dev/null])
AT_CHECK([grep '@3' < prog2.java > /dev/null])

# 'ê¤' is the last printable Shift-JIS character with respect to the byte order.
# See http://charset.7jp.net/sjis.html
AT_DATA([prog3.cob], [
IDENTIFICATION DIVISION.
PROGRAM-ID. prog3.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 F0 PIC X(30) VALUE "ê¤1".
PROCEDURE DIVISION.
MOVE "ê¤2" TO F0.
DISPLAY "ê¤3".
])

AT_CHECK([cobj prog3.cob])
AT_CHECK([grep 'ê¤1' < prog3.java > /dev/null])
AT_CHECK([grep 'ê¤2' < prog3.java > /dev/null])
AT_CHECK([grep 'ê¤3' < prog3.java > /dev/null])

AT_CLEANUP
6 changes: 3 additions & 3 deletions tests/package.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Signature of the current package.
m4_define([AT_PACKAGE_NAME], [opensource COBOL 4J])
m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.1.4])
m4_define([AT_PACKAGE_VERSION], [1.1.4])
m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.1.4])
m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.1.5])
m4_define([AT_PACKAGE_VERSION], [1.1.5])
m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.1.5])
m4_define([AT_PACKAGE_BUGREPORT], [ws-opensource-cobol-contact@osscons.jp])
8 changes: 4 additions & 4 deletions win/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
#define ICONV_CONST

/* Name of package */
#define PACKAGE "opensource-cobol4j-1.1.4"
#define PACKAGE "opensource-cobol4j-1.1.5"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "ws-opensource-cobol-contact@osscons.jp"
Expand All @@ -308,13 +308,13 @@
#define PACKAGE_NAME "opensource COBOL 4J"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "opensource COBOL 4J 1.1.4"
#define PACKAGE_STRING "opensource COBOL 4J 1.1.5"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "opensource-cobol4j-1.1.4"
#define PACKAGE_TARNAME "opensource-cobol4j-1.1.5"

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.1.4"
#define PACKAGE_VERSION "1.1.5"

/* Define a patch level */
#define PATCH_LEVEL 0
Expand Down
Loading