bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] BUG: "COPY REPLACING ..." and REQUEST for "mini-


From: Thomas Biehler
Subject: Re: [open-cobol-list] BUG: "COPY REPLACING ..." and REQUEST for "mini-listing"
Date: Mon Feb 16 08:35:12 2004
User-agent: KMail/1.4.3

Hi Keisuke, 

> I have fixed it and implemented a better replacement routine
> as well.  Now open-cobol passes most of the SM module of the
> NIST test suite except some minor tests.
>
> By this change, partial replacement no longer works as before.

Very good News!  (I think for all open-cobol users!)
One important step to 1985 / 2002 standard conforming behavior!

Great work!

I have tested it with a (first) real world program.
(with both requirements: "REPLACEMENT- order" and "partial replacment")
It looks fine! (after a small workaround on the following bug)

BUG: (i am not sure, but i think a new introdruced bug)
=======================================
The separators  comma "," and semicolon ";" 
generates syntax errors if they are used 
in a copy-statement.

you can integrate the following test in copy.at if you want.

It stress this "separator standard feature" !
(see ANSI/1985  4.2.1 (2)  or  ISO/2002  5.1.7)

===================================================
AT_SETUP([COPY: separators in copy-statement])
AT_KEYWORDS([copy])

AT_DATA([copy.inc], [
       01 TEST-VAR PIC X(2) VALUE "OK".
])

AT_DATA([prog.cob], [
       IDENTIFICATION   DIVISION.
       PROGRAM-ID.      prog.
       DATA             DIVISION.
       WORKING-STORAGE  SECTION.
       COPY "copy.inc"
          REPLACING ==TEST-VAR==, BY ==FIRST-MATCH==,
                 ,  ==TEST-VAR==; BY ==SECOND-MATCH==;
                 ;  ==TEST-VAR== , BY ==THIRD-MATCH==
                    ==TEST-VAR== ; BY ==FOURTH-MATCH==.
       PROCEDURE        DIVISION.
           DISPLAY FIRST-MATCH NO ADVANCING.
           STOP RUN.
])

AT_CHECK([${COMPILE} -o prog prog.cob])
AT_CHECK([./prog], [0], [OK])

AT_CLEANUP
====================================================

Thomas

P.S.   i can also answer after a short response time !!!   :-))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]