From 2430a2b7b89f257266eb522eaaad751dd3cd086d Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Fri, 19 Jan 2024 18:50:20 +0100 Subject: [PATCH 1/2] Preserve case of original source text --- src/lsp/cobol_indent/indent_check.ml | 21 +- src/lsp/cobol_indent/indent_keywords.ml | 18 +- src/lsp/cobol_parser/text_categorizer.mll | 3 +- src/lsp/cobol_parser/text_lexer.ml | 2 +- src/lsp/cobol_preproc/preproc_state.ml | 2 +- src/lsp/cobol_preproc/src_lexer.mll | 4 +- src/lsp/cobol_preproc/src_lexing.ml | 7 +- src/lsp/cobol_preproc/text.ml | 10 +- src/lsp/cobol_preproc/text.mli | 2 + src/lsp/cobol_preproc/text_processor.ml | 2 +- test/cobol_parsing/cS_tokens.ml | 26 +- test/cobol_parsing/decimal_point.ml | 6 +- test/cobol_parsing/test_appending.ml | 38 +- test/cobol_parsing/test_appending_large.ml | 130 +- test/cobol_parsing/test_stuttering.ml | 126 +- test/cobol_parsing/tokens.ml | 2 +- test/cobol_preprocessing/auto_sourceformat.ml | 10 +- .../auto_sourceformat_rewind.ml | 12 +- test/cobol_preprocessing/source_lines.ml | 4 +- test/output-tests/preproc.expected | 2642 ++++++++--------- test/output-tests/run_file.expected | 10 +- test/output-tests/run_misc.expected | 4 +- test/output-tests/syn_copy.expected | 2 +- test/output-tests/syn_misc.expected | 2 +- 24 files changed, 1564 insertions(+), 1521 deletions(-) diff --git a/src/lsp/cobol_indent/indent_check.ml b/src/lsp/cobol_indent/indent_check.ml index cd1ba1738..dfb2e6369 100644 --- a/src/lsp/cobol_indent/indent_check.ml +++ b/src/lsp/cobol_indent/indent_check.ml @@ -548,12 +548,14 @@ and check_statement (text:text) state ifcheck = (*TODO: find a better way to distinguish PERFORM(inline) and PERFORM_CLOSED(out-of-line)*) (*A bug here, TODO.md for details*) - | {payload = TextWord "PERFORM"; loc } :: _ :: {payload = TextWord "TIMES"; _} :: wordlist - | {payload = TextWord "PERFORM"; loc } :: {payload = TextWord ("UNTIL"|"VARYING"|"WITH"|"TEST"); _} - :: wordlist -> + | { payload = TextWord "PERFORM"; loc } :: _ :: + { payload = TextWord "TIMES"; _} :: wordlist + | { payload = TextWord "PERFORM"; loc } :: + { payload = TextWord ("UNTIL"|"VARYING"|"WITH"|"TEST"); _} :: wordlist -> handle_open_scope PERFORM loc wordlist state ifcheck - | {payload = TextWord "ELSE"; loc} :: {payload = TextWord "IF"; _} :: wordlist -> + | { payload = TextWord "ELSE"; loc } :: + { payload = TextWord "IF"; _ } :: wordlist -> let context = exp_scope_termination THEN context in begin match context with | (THEN, _) :: (IF, _) :: context' -> @@ -1228,6 +1230,17 @@ and check_fun = function let check_indentation (text:text) (state:indent_state) = + let text = + (* Note: the above code assumes upper-cased text words, so that's what we + need to feed it. *) + let open Cobol_common.Srcloc.INFIX in + let open Cobol_preproc.Text.TYPES in + EzList.tail_map begin fun tw -> match ~&tw with + | TextWord w -> TextWord (String.uppercase_ascii w) &@<- tw + | CDirWord w -> CDirWord (String.uppercase_ascii w) &@<- tw + | _ -> tw + end text + in match state.range with | None -> check_fun state.scope text state true diff --git a/src/lsp/cobol_indent/indent_keywords.ml b/src/lsp/cobol_indent/indent_keywords.ml index 366841b04..b8ff03ea7 100644 --- a/src/lsp/cobol_indent/indent_keywords.ml +++ b/src/lsp/cobol_indent/indent_keywords.ml @@ -11,6 +11,13 @@ (* *) (**************************************************************************) +(* Mappings to/from tokens and keyword strings are very redundant with what's + (auto-generated!) in `cobol_parser/text_keywords.ml` (and a little bit of + manual mapping from `combined_tokens` in `cobol_parser/text_tokenizer.ml`. + + TODO: use the aforementioned associations instead of redefining them + below. *) + open Indent_type (*data division *) @@ -42,12 +49,11 @@ let keyword_stmt = "TERMINATE"; "UNLOCK"; "UNSTRING"; "USE"; "VALIDATE"; "WRITE"; (*standard 1985*) "ALTER"; "DISABLE"; "ENABLE"; "PURGE"; "RECEIVE"; "SEND";] -let keyword_stmt_tbl = Hashtbl.create 16 -let () = - List.iter (fun x -> - Hashtbl.add keyword_stmt_tbl x ()) - keyword_stmt -let is_statement = Hashtbl.mem keyword_stmt_tbl +let is_statement = + let keyword_stmt_tbl = Hashtbl.create 16 in + List.iter (fun x -> Hashtbl.add keyword_stmt_tbl x ()) keyword_stmt; + fun word -> + Hashtbl.mem keyword_stmt_tbl word let str_proc_keyword_tbl = Hashtbl.create 16 diff --git a/src/lsp/cobol_parser/text_categorizer.mll b/src/lsp/cobol_parser/text_categorizer.mll index abc538df0..91359e22a 100644 --- a/src/lsp/cobol_parser/text_categorizer.mll +++ b/src/lsp/cobol_parser/text_categorizer.mll @@ -59,7 +59,8 @@ rule token = parse | (sign? digit* as n) (['.' ','] as sep) (digit+ as d) { Numeric (n, Some (sep, d, None)) } - | (sign? digit* as n) (['.' ','] as sep) (digit+ as d) 'E' (exponent as e) + | (sign? digit* as n) (['.' ','] as sep) (digit+ as d) ['E' 'e'] + (exponent as e) { Numeric (n, Some (sep, d, Some e)) } | ident as s (* 31 characters max *) diff --git a/src/lsp/cobol_parser/text_lexer.ml b/src/lsp/cobol_parser/text_lexer.ml index 48cf9d9d0..cb76840ab 100644 --- a/src/lsp/cobol_parser/text_lexer.ml +++ b/src/lsp/cobol_parser/text_lexer.ml @@ -154,7 +154,7 @@ let reserve_words lexer : Cobol_config.words_spec -> unit = (* --- *) let token_of_keyword { token_of_keyword; _ } s = - match Hashtbl.find token_of_keyword s with + match Hashtbl.find token_of_keyword (String.uppercase_ascii s) with | { token; enabled = true; reserved = true } -> token | _ -> raise Not_found diff --git a/src/lsp/cobol_preproc/preproc_state.ml b/src/lsp/cobol_preproc/preproc_state.ml index 5a7c6c4c7..681de6ad3 100644 --- a/src/lsp/cobol_preproc/preproc_state.ml +++ b/src/lsp/cobol_preproc/preproc_state.ml @@ -59,7 +59,7 @@ let find_phrase first_word ?(prefix = `Same) text : _ result = Ok { prefix; phrase; suffix } (** [find_full_phrase words ~search_deep ~try_hard ~prefix text] looks for a - pharse comprised of all words in [words] and termiates with a period in + phrase comprised of all words in [words] that termiates with a period in [text]. If [prefix = `Rev] and upon success, the prefix is reveresed in the returned structure. diff --git a/src/lsp/cobol_preproc/src_lexer.mll b/src/lsp/cobol_preproc/src_lexer.mll index e430f7a49..20b27ae32 100644 --- a/src/lsp/cobol_preproc/src_lexer.mll +++ b/src/lsp/cobol_preproc/src_lexer.mll @@ -582,7 +582,7 @@ and cdtoken = parse { cdtoken lexbuf } | (nonblank+ as s) - { CDTok (try Hashtbl.find cdtoken_of_keyword s + { CDTok (try Hashtbl.find cdtoken_of_keyword (String.uppercase_ascii s) with Not_found -> TEXT_WORD s) } | eof @@ -599,7 +599,7 @@ and pptoken = parse | '.' { PPTok PERIOD } | (([^ '(' ')']+) as s) - { PPTok (try Hashtbl.find pptoken_of_keyword s + { PPTok (try Hashtbl.find pptoken_of_keyword (String.uppercase_ascii s) with Not_found -> TEXT_WORD s) } | eof diff --git a/src/lsp/cobol_preproc/src_lexing.ml b/src/lsp/cobol_preproc/src_lexing.ml index a354599dc..299b3e95d 100644 --- a/src/lsp/cobol_preproc/src_lexing.ml +++ b/src/lsp/cobol_preproc/src_lexing.ml @@ -224,9 +224,8 @@ let unexpected (type k) (kind: k c) (* --- *) -(* Switch to upper-cased representation already: *) let textword s = - TextWord (String.uppercase_ascii ~&s) &@<- s + TextWord ~&s &@<- s let cdirword ?marker ~start_pos ~end_pos s state = let s = remove_blanks s in @@ -238,7 +237,7 @@ let cdirword ?marker ~start_pos ~end_pos s state = s, start_pos in let loc = raw_loc ~start_pos ~end_pos state in - emit (CDirWord (String.uppercase_ascii s) &@ loc) state + emit (CDirWord s &@ loc) state let rev_pseudotext: text -> _ state -> pseudotext * _ state = fun text state -> @@ -392,7 +391,7 @@ let unclosed_ebcdics = let symc = "[0-9][0-9, ]*" in (* symbolic EBCDIC *) let dblq = "\\([^\"]\\|\"" ^ symc ^ "\"\\|\"\"\\)*\"" ^ symc in let splq = "\\([^']\\|'" ^ symc ^ "\"\\|''\\)*'" ^ symc in - let re = Str.regexp ("^\\(" ^ dblq ^ "\\|" ^ splq ^ "\\)$") in + let re = Str.regexp_case_fold ("^\\(" ^ dblq ^ "\\|" ^ splq ^ "\\)$") in fun str -> Str.string_match re str 0 let quoted_alphanum ?(fitting = Nominal) ~knd diff --git a/src/lsp/cobol_preproc/text.ml b/src/lsp/cobol_preproc/text.ml index 2bd6c28b1..2eec3c1a3 100644 --- a/src/lsp/cobol_preproc/text.ml +++ b/src/lsp/cobol_preproc/text.ml @@ -85,9 +85,13 @@ include FMT (* Various predicates on source-flagged character strings *) let textwordp t = match ~&t with TextWord _ -> true | _ -> false -let textword_eqp ~eq:w t = match ~&t with TextWord t -> t = w | _ -> false +let textword_eqp ~eq:w t = match ~&t with + | TextWord t -> String.uppercase_ascii t = String.uppercase_ascii w + | _ -> false let cdirp t = match ~&t with CDirWord _ -> true | _ -> false -let cdir_eqp ~eq:w t = match ~&t with CDirWord t -> t = w | _ -> false +let cdir_eqp ~eq:w t = match ~&t with + | CDirWord t -> String.uppercase_ascii t = String.uppercase_ascii w + | _ -> false (* Manipulating pseudo-words and text *) @@ -108,7 +112,7 @@ let split_pseudo_string w = (PwText t &@ tloc) :: acc, wloc | Str.Delim d -> let dloc, wloc = split_loc wloc d in - (PwDelim (d, Str.regexp (Str.quote d)) &@ dloc) :: acc, wloc + (PwDelim (d, Str.regexp_case_fold (Str.quote d)) &@ dloc) :: acc, wloc end ([], ~@w) in List.rev pseudoword_items diff --git a/src/lsp/cobol_preproc/text.mli b/src/lsp/cobol_preproc/text.mli index 5f6ce33de..401ea685d 100644 --- a/src/lsp/cobol_preproc/text.mli +++ b/src/lsp/cobol_preproc/text.mli @@ -24,6 +24,8 @@ include module type of Text_types and type comment = Text_types.comment and type comments = Text_types.comments +(** [*_eqp] functions below perform (ASCII) case-insensitive comparisons. *) + val textwordp : text_word with_loc -> bool val textword_eqp : eq:string -> text_word with_loc -> bool diff --git a/src/lsp/cobol_preproc/text_processor.ml b/src/lsp/cobol_preproc/text_processor.ml index 77c795294..a8735a103 100644 --- a/src/lsp/cobol_preproc/text_processor.ml +++ b/src/lsp/cobol_preproc/text_processor.ml @@ -57,7 +57,7 @@ let partial_word (type k) (req: k partial_word_request) words : (k, _) result = let partial_subst (k: partial_replacing) ({ payload = pat; _ } as repl_from) = { partial_subst_dir = k.repl_dir; partial_subst_len = String.length pat; - partial_subst_regexp = Str.regexp @@ match k.repl_dir with + partial_subst_regexp = Str.regexp_case_fold @@ match k.repl_dir with | Leading when k.repl_strict -> "^" ^ Str.quote pat ^ "\\(.+\\)$" | Leading -> "^" ^ Str.quote pat ^ "\\(.*\\)$" | Trailing when k.repl_strict -> "^\\(.+\\)" ^ Str.quote pat ^ "$" diff --git a/test/cobol_parsing/cS_tokens.ml b/test/cobol_parsing/cS_tokens.ml index f99561cec..e7ec42162 100644 --- a/test/cobol_parsing/cS_tokens.ml +++ b/test/cobol_parsing/cS_tokens.ml @@ -30,7 +30,7 @@ let%expect_test "context-sensitive-tokens" = STOP RUN. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., DATA, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., DATA, DIVISION, ., WORKING-STORAGE, SECTION, ., DIGITS[01], WORD[AWAY-FROM-ZERO], PICTURE, PICTURE_STRING[9], VALUE, DIGITS[0], ., DIGITS[01], WORD[BYTE-LENGTH], PICTURE, PICTURE_STRING[9], ., DIGITS[01], WORD[X], @@ -55,7 +55,7 @@ let%expect_test "context-sensitive-tokens-bis" = STOP RUN. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., DATA, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., DATA, DIVISION, ., WORKING-STORAGE, SECTION, ., DIGITS[01], WORD[AWAY-FROM-ZERO], PICTURE, PICTURE_STRING[9], VALUE, DIGITS[0], ., DIGITS[01], WORD[BYTE-LENGTH], PICTURE, PICTURE_STRING[9], ., DIGITS[01], WORD[X], @@ -77,7 +77,7 @@ let%expect_test "context-sensitive-tokens-ter" = STOP RUN. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., DATA, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., DATA, DIVISION, ., WORKING-STORAGE, SECTION, ., DIGITS[01], WORD[AWAY-FROM-ZERO], PICTURE, PICTURE_STRING[9], VALUE, DIGITS[0], ., DIGITS[01], WORD[BYTE-LENGTH], PICTURE, PICTURE_STRING[9], ., DIGITS[01], WORD[X], @@ -105,7 +105,7 @@ let%expect_test "context-sensitive-tokens-with-syntax-errors" = STOP RUN. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., DATA, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., DATA, DIVISION, ., WORKING-STORAGE, SECTION, ., DIGITS[01], WORD[AWAY-FROM-ZERO], PICTURE, PICTURE_STRING[9], VALUE, DIGITS[0], ., DIGITS[01], WORD[BYTE-LENGTH], PICTURE, PICTURE_STRING[9], ., DIGITS[01], WORD[X], @@ -115,3 +115,21 @@ let%expect_test "context-sensitive-tokens-with-syntax-errors" = DISPLAY, WORD[X], WORD[AWAY-FROM-ZERO], NO, ADVANCING, END-DISPLAY, ., STOP, RUN, ., EOF |}];; + +let%expect_test "context-sensitive-tokens-lower-case" = + Parser_testing.show_parsed_tokens {| + program-id. prog. + data division. + working-storage section. + 01 byte-length pic 9. + 01 X constant byte-length byte-length. + procedure division. + |}; + (* Note the `WORD[BYTE-LENGTH]` below, that was originally lower-case. TODO: + find a *clean* way to fix that. *) + [%expect {| + PROGRAM-ID, ., INFO_WORD[prog], ., DATA, DIVISION, ., WORKING-STORAGE, + SECTION, ., DIGITS[01], WORD[byte-length], PICTURE, PICTURE_STRING[9], ., + DIGITS[01], WORD[X], CONSTANT, BYTE-LENGTH, WORD[BYTE-LENGTH], ., PROCEDURE, + DIVISION, ., EOF +|}];; diff --git a/test/cobol_parsing/decimal_point.ml b/test/cobol_parsing/decimal_point.ml index 281cdd17f..978c20c99 100644 --- a/test/cobol_parsing/decimal_point.ml +++ b/test/cobol_parsing/decimal_point.ml @@ -22,7 +22,7 @@ let%expect_test "default-point/comma" = DISPLAY -1,1. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., PROCEDURE, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., PROCEDURE, DIVISION, ., DISPLAY, FIXED[1.1], DISPLAY, DIGITS[1], DIGITS[1], DISPLAY, FIXED[-1.1], DISPLAY, SINT[-1], DIGITS[1], ., EOF |}];; @@ -42,7 +42,7 @@ let%expect_test "decimal-point-is-comma" = DISPLAY -1,1. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., ENVIRONMENT, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., ENVIRONMENT, DIVISION, ., CONFIGURATION, SECTION, ., SPECIAL-NAMES, ., DECIMAL-POINT, IS, COMMA, ., PROCEDURE, DIVISION, ., DISPLAY, DIGITS[1], DIGITS[1], DISPLAY, FIXED[1,1], DISPLAY, SINT[-1], DIGITS[1], DISPLAY, FIXED[-1,1], ., EOF @@ -66,7 +66,7 @@ let%expect_test "decimal-point-is-comma-with-missing-period" = DISPLAY -1,1. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., ENVIRONMENT, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., ENVIRONMENT, DIVISION, ., CONFIGURATION, SECTION, ., SPECIAL-NAMES, ., DECIMAL-POINT, IS, COMMA, PROCEDURE, DIVISION, DISPLAY, DIGITS[1], DIGITS[1], DISPLAY, FIXED[1,1], DISPLAY, SINT[-1], DIGITS[1], DISPLAY, FIXED[-1,1], ., EOF diff --git a/test/cobol_parsing/test_appending.ml b/test/cobol_parsing/test_appending.ml index 726e5abba..7ff7232cf 100644 --- a/test/cobol_parsing/test_appending.ml +++ b/test/cobol_parsing/test_appending.ml @@ -42,13 +42,13 @@ _|_ STOP RUN. Appending chunk 3/5 @ 2:0-3:0 (" PROGRAM-ID. prog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 4/5 @ 3:0-4:0 (" PROCEDURE DIVISION...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -56,7 +56,7 @@ _|_ STOP RUN. Appending chunk 5/5 @ 4:0-5:2 (" STOP RUN.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -82,13 +82,13 @@ let%expect_test "line-by-line-incremental-small-2" = Appending chunk 3/5 @ 2:7-3:7 (" PROGRAM-ID. prog.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 4/5 @ 3:7-4:7 (" PROCEDURE DIVISION.\n ...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -96,7 +96,7 @@ let%expect_test "line-by-line-incremental-small-2" = Appending chunk 5/5 @ 4:7-5:2 (" STOP RUN.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -126,19 +126,19 @@ _|_ STOP RUN._|_ Appending chunk 4/9 @ 2:0-2:25 (" PROGRAM-ID. prog.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 5/9 @ 2:25-3:0 ("\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 6/9 @ 3:0-3:27 (" PROCEDURE DIVISION.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -146,7 +146,7 @@ _|_ STOP RUN._|_ Appending chunk 7/9 @ 3:27-4:0 ("\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -154,7 +154,7 @@ _|_ STOP RUN._|_ Appending chunk 8/9 @ 4:0-4:21 (" STOP RUN.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -162,7 +162,7 @@ _|_ STOP RUN._|_ Appending chunk 9/9 @ 4:21-5:2 ("\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -225,13 +225,13 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 12/23 @ 2:21-3:0 ("rog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 13/23 @ 3:0-3:5 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 14/23 @ 3:5-3:10 (" PR") @@ -253,7 +253,7 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 18/23 @ 3:25-4:2 ("N.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -261,7 +261,7 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 19/23 @ 4:2-4:7 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -269,7 +269,7 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 20/23 @ 4:7-4:12 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -281,7 +281,7 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 22/23 @ 4:17-5:0 ("RUN.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -289,7 +289,7 @@ let%expect_test "chunk-by-chunk-incremental-small-4" = Appending chunk 23/23 @ 5:0-5:2 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. diff --git a/test/cobol_parsing/test_appending_large.ml b/test/cobol_parsing/test_appending_large.ml index 966db6a3a..d8051526e 100644 --- a/test/cobol_parsing/test_appending_large.ml +++ b/test/cobol_parsing/test_appending_large.ml @@ -203,34 +203,34 @@ let%expect_test "line-by-line-incremental-mf" = Appending chunk 157/157 @ 210:1-211:0 ("\r\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. REPORTEXAMPLESUMMARY. - AUTHOR. MICHAEL COUGHLAN . + PROGRAM-ID. ReportExampleSummary. + AUTHOR. Michael Coughlan . ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. - SELECT SALESFILE ASSIGN "GBSALES.DAT" SEQUENTIAL. - SELECT PRINTFILE ASSIGN "SUMMARYSALESREPORT.LPT". + SELECT SalesFile ASSIGN "GBSALES.DAT" SEQUENTIAL. + SELECT PrintFile ASSIGN "SUMMARYSALESREPORT.LPT". DATA DIVISION. FILE SECTION. - FD SALESFILE. - 01 SALESRECORD. - 88 ENDOFFILE VALUE HIGH-VALUES. - 02 CITYCODE PIC 9. - 02 SALESPERSONNUM PIC 9. - 02 VALUEOFSALE PIC 9(4)V99. - FD PRINTFILE - REPORT IS SALESREPORT. + FD SalesFile. + 01 SalesRecord. + 88 EndOfFile VALUE HIGH-VALUES. + 02 CityCode PIC 9. + 02 SalesPersonNum PIC 9. + 02 ValueOfSale PIC 9(4)V99. + FD PrintFile + REPORT IS SalesReport. WORKING-STORAGE SECTION. - 01 NAMETABLE. - 02 TABLEVALUES. + 01 NameTable. + 02 TableValues. 03 FILLER PIC X(18) VALUE "Dublin Belfast ". 03 FILLER PIC X(18) VALUE "Cork Galway ". 03 FILLER PIC X(18) VALUE "Sligo Waterford". 03 FILLER PIC X(9) VALUE "Limerick". - 02 FILLER REDEFINES TABLEVALUES. - 03 CITYNAME PIC X(9) OCCURS 7. - 01 RATETABLE. - 02 TABLEVALUES. + 02 FILLER REDEFINES TableValues. + 03 CityName PIC X(9) OCCURS 7. + 01 RateTable. + 02 TableValues. 03 FILLER PIC X(35) VALUE "12300321004350056700123002340034500". 03 FILLER PIC X(35) VALUE "12300543001230034200111001220013300". 03 FILLER PIC X(35) VALUE "12000321001760018700133001440015500". @@ -240,19 +240,19 @@ let%expect_test "line-by-line-incremental-mf" = 03 FILLER PIC X(35) VALUE "16700156001450014600222001110021200". 03 FILLER PIC X(35) VALUE "12000132001230014300121003210043200". 03 FILLER PIC X(35) VALUE "15400165001640017600111007770033300". - 02 FILLER REDEFINES TABLEVALUES. - 03 CITY OCCURS 7. - 04 FIXEDRATE PIC 9(3)V99 OCCURS 9. - 01 MISCVARIABLES. - 02 COMMISSION PIC 9(4)V99. - 02 PERCENTAGE PIC V99 VALUE .05. - 02 SALARY PIC 9(6)V99. - 02 SALESPERSONNOW PIC 9. - 02 CITYNOW PIC 9. + 02 FILLER REDEFINES TableValues. + 03 City OCCURS 7. + 04 FixedRate PIC 9(3)V99 OCCURS 9. + 01 MiscVariables. + 02 Commission PIC 9(4)V99. + 02 Percentage PIC V99 VALUE .05. + 02 Salary PIC 9(6)V99. + 02 SalesPersonNow PIC 9. + 02 CityNow PIC 9. REPORT SECTION. - RD SALESREPORT - CONTROL FINAL CITYCODE - SALESPERSONNUM + RD SalesReport + CONTROL FINAL CityCode + SalesPersonNum PAGE LIMIT IS 66 LINES HEADING 1 FIRST DETAIL 6 @@ -272,46 +272,46 @@ let%expect_test "line-by-line-incremental-mf" = 03 COLUMN LEFT 2 PIC X(4) VALUE "Name". 03 COLUMN LEFT 13 PIC X(6) VALUE "Number". 03 COLUMN LEFT 28 PIC X(5) VALUE "Value". - 01 DETAILLINE TYPE DETAIL. + 01 DetailLine TYPE DETAIL. 02 LINE NUMBER PLUS 1. - 03 COLUMN LEFT 1 PIC X(9) SOURCE CITYNAME(CITYCODE) GROUP. - 03 COLUMN LEFT 15 PIC 9 SOURCE SALESPERSONNUM GROUP. - 03 COLUMN LEFT 25 PIC $$,$$$.99 SOURCE VALUEOFSALE . - 01 SALESPERSONGRP TYPE CF FOR SALESPERSONNUM NEXT GROUP IS PLUS 2. + 03 COLUMN LEFT 1 PIC X(9) SOURCE CityName(CityCode) GROUP. + 03 COLUMN LEFT 15 PIC 9 SOURCE SalesPersonNum GROUP. + 03 COLUMN LEFT 25 PIC $$,$$$.99 SOURCE ValueOfSale . + 01 SalesPersonGrp TYPE CF FOR SalesPersonNum NEXT GROUP IS PLUS 2. 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(21) VALUE "Sales for salesperson". - 03 COLUMN LEFT 37 PIC 9 SOURCE SALESPERSONNUM . + 03 COLUMN LEFT 37 PIC 9 SOURCE SalesPersonNum . 03 COLUMN LEFT 43 PIC X VALUE "=". - 03 SMS COLUMN LEFT 45 PIC $$$$$,$$$.99 SUM VALUEOFSALE . + 03 SMS COLUMN LEFT 45 PIC $$$$$,$$$.99 SUM ValueOfSale . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(19) VALUE "Sales commission is". 03 COLUMN LEFT 43 PIC X VALUE "=". - 03 COLUMN LEFT 45 PIC $$$$$,$$$.99 SOURCE COMMISSION . + 03 COLUMN LEFT 45 PIC $$$$$,$$$.99 SOURCE Commission . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(22) VALUE "Salesperson salary is". 03 COLUMN LEFT 43 PIC X VALUE "=". - 03 COLUMN LEFT 45 PIC $$$$$,$$$.99 SOURCE SALARY . + 03 COLUMN LEFT 45 PIC $$$$$,$$$.99 SOURCE Salary . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(30) VALUE "Current salesperson number = ". - 03 COLUMN LEFT 45 PIC 9 SOURCE SALESPERSONNOW . + 03 COLUMN LEFT 45 PIC 9 SOURCE SalesPersonNow . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(30) VALUE "Previous salesperson number = ". - 03 COLUMN LEFT 45 PIC 9 SOURCE SALESPERSONNUM . - 01 CITYGRP TYPE CF FOR CITYCODE NEXT GROUP IS PLUS 2. + 03 COLUMN LEFT 45 PIC 9 SOURCE SalesPersonNum . + 01 CityGrp TYPE CF FOR CityCode NEXT GROUP IS PLUS 2. 02 LINE NUMBER PLUS 2. 03 COLUMN LEFT 15 PIC X(9) VALUE "Sales for". - 03 COLUMN LEFT 25 PIC X(9) SOURCE CITYNAME(CITYCODE) . + 03 COLUMN LEFT 25 PIC X(9) SOURCE CityName(CityCode) . 03 COLUMN LEFT 43 PIC X VALUE "=". 03 CS COLUMN LEFT 45 PIC $$$$$,$$$.99 SUM SMS . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(12) VALUE "Current city". 03 COLUMN LEFT 43 PIC X VALUE "=". - 03 COLUMN LEFT 45 PIC 9 SOURCE CITYNOW . + 03 COLUMN LEFT 45 PIC 9 SOURCE CityNow . 02 LINE NUMBER PLUS 1. 03 COLUMN LEFT 15 PIC X(13) VALUE "Previous city". 03 COLUMN LEFT 43 PIC X VALUE "=". - 03 COLUMN LEFT 45 PIC 9 SOURCE CITYCODE . - 01 TOTALSALESGRP TYPE CF FOR FINAL. + 03 COLUMN LEFT 45 PIC 9 SOURCE CityCode . + 01 TotalSalesGrp TYPE CF FOR FINAL. 02 LINE NUMBER PLUS 4. 03 COLUMN LEFT 15 PIC X(11) VALUE "Total sales". 03 COLUMN LEFT 43 PIC X VALUE "=". @@ -323,36 +323,36 @@ let%expect_test "line-by-line-incremental-mf" = 03 COLUMN LEFT 52 PIC Z9 SOURCE PAGE-COUNTER . PROCEDURE DIVISION. DECLARATIVES. - CALC SECTION. - USE BEFORE REPORTING SALESPERSONGRP. - CALCULATE-SALARY. - MULTIPLY SMS BY PERCENTAGE GIVING COMMISSION ROUNDED END-MULTIPLY. - ADD COMMISSION TO FIXEDRATE(CITYCODE, SALESPERSONNUM) GIVING SALARY END-ADD. + Calc SECTION. + USE BEFORE REPORTING SalesPersonGrp. + Calculate-Salary. + MULTIPLY SMS BY Percentage GIVING Commission ROUNDED END-MULTIPLY. + ADD Commission TO FixedRate(CityCode, SalesPersonNum) GIVING Salary END-ADD. END DECLARATIVES. - MAIN SECTION. + Main SECTION. - BEGIN. - OPEN INPUT SALESFILE. + Begin. + OPEN INPUT SalesFile. - OPEN OUTPUT PRINTFILE. + OPEN OUTPUT PrintFile. - READ SALESFILE AT END SET ENDOFFILE TO TRUE END-READ. + READ SalesFile AT END SET EndOfFile TO TRUE END-READ. - INITIATE SALESREPORT. + INITIATE SalesReport. - PERFORM PRINTSALARYREPORT UNTIL ENDOFFILE. + PERFORM PrintSalaryReport UNTIL EndOfFile. - TERMINATE SALESREPORT. + TERMINATE SalesReport. - CLOSE SALESFILE PRINTFILE. + CLOSE SalesFile PrintFile. STOP RUN. - PRINTSALARYREPORT. - MOVE CITYCODE TO CITYNOW. + PrintSalaryReport. + MOVE CityCode TO CityNow. - MOVE SALESPERSONNUM TO SALESPERSONNOW. + MOVE SalesPersonNum TO SalesPersonNow. - GENERATE SALESREPORT. + GENERATE SalesReport. - READ SALESFILE AT END SET ENDOFFILE TO TRUE END-READ. + READ SalesFile AT END SET EndOfFile TO TRUE END-READ. |}];; diff --git a/test/cobol_parsing/test_stuttering.ml b/test/cobol_parsing/test_stuttering.ml index c96f4cae4..22646ed60 100644 --- a/test/cobol_parsing/test_stuttering.ml +++ b/test/cobol_parsing/test_stuttering.ml @@ -41,7 +41,7 @@ _|_ STOP RUN. Appending chunk 2/4 @ 1:0-3:0 (" IDENTIFICATION DIV...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 2/4 back @ 1:0-2:0 (" IDENTIFICATION DIV...) @@ -51,7 +51,7 @@ _|_ STOP RUN. Appending chunk 3/4 @ 2:0-4:0 (" PROGRAM-ID. prog.\...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -59,13 +59,13 @@ _|_ STOP RUN. Cutting chunk 3/4 back @ 2:0-3:0 (" PROGRAM-ID. prog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 4/4 @ 3:0-5:2 (" PROCEDURE DIVISION...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -91,7 +91,7 @@ let%expect_test "line-by-line-incremental-small-2" = Appending chunk 2/4 @ 1:7-3:7 (" IDENTIFICATION DIVISION.\...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 2/4 back @ 1:7-2:7 (" IDENTIFICATION DIVISION.\...) @@ -101,7 +101,7 @@ let%expect_test "line-by-line-incremental-small-2" = Appending chunk 3/4 @ 2:7-4:7 (" PROGRAM-ID. prog.\n ...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -109,13 +109,13 @@ let%expect_test "line-by-line-incremental-small-2" = Cutting chunk 3/4 back @ 2:7-3:7 (" PROGRAM-ID. prog.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 4/4 @ 3:7-5:2 (" PROCEDURE DIVISION.\n ...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -149,7 +149,7 @@ _|_ STOP RUN._|_ Appending chunk 3/8 @ 1:32-2:25 ("\n PROGRAM-ID. prog.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 3/8 back @ 1:32-2:0 ("\n") @@ -159,19 +159,19 @@ _|_ STOP RUN._|_ Appending chunk 4/8 @ 2:0-3:0 (" PROGRAM-ID. prog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 4/8 back @ 2:0-2:25 (" PROGRAM-ID. prog.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 5/8 @ 2:25-3:27 ("\n PROCEDURE DIVISI...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -179,13 +179,13 @@ _|_ STOP RUN._|_ Cutting chunk 5/8 back @ 2:25-3:0 ("\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 6/8 @ 3:0-4:0 (" PROCEDURE DIVISION...) Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -193,7 +193,7 @@ _|_ STOP RUN._|_ Cutting chunk 6/8 back @ 3:0-3:27 (" PROCEDURE DIVISION.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -201,7 +201,7 @@ _|_ STOP RUN._|_ Appending chunk 7/8 @ 3:27-4:21 ("\n STOP RUN.") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -209,7 +209,7 @@ _|_ STOP RUN._|_ Cutting chunk 7/8 back @ 3:27-4:0 ("\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -217,7 +217,7 @@ _|_ STOP RUN._|_ Appending chunk 8/8 @ 4:0-5:2 (" STOP RUN.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -316,7 +316,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 11/22 @ 2:16-3:0 ("ID. prog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 11/22 back @ 2:16-2:21 ("ID. p") @@ -326,13 +326,13 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 12/22 @ 2:21-3:5 ("rog.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 12/22 back @ 2:21-3:0 ("rog.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 13/22 @ 3:0-3:10 (" PR") @@ -342,7 +342,7 @@ let%expect_test "line-by-line-incremental-small-4" = Cutting chunk 13/22 back @ 3:0-3:5 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 14/22 @ 3:5-3:15 (" PROCEDU") @@ -372,7 +372,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 17/22 @ 3:20-4:2 ("VISION.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -384,7 +384,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 18/22 @ 3:25-4:7 ("N.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -392,7 +392,7 @@ let%expect_test "line-by-line-incremental-small-4" = Cutting chunk 18/22 back @ 3:25-4:2 ("N.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -400,7 +400,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 19/22 @ 4:2-4:12 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -408,7 +408,7 @@ let%expect_test "line-by-line-incremental-small-4" = Cutting chunk 19/22 back @ 4:2-4:7 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -420,7 +420,7 @@ let%expect_test "line-by-line-incremental-small-4" = Cutting chunk 20/22 back @ 4:7-4:12 (" ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -428,7 +428,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 21/22 @ 4:12-5:0 ("STOP RUN.\n") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -440,7 +440,7 @@ let%expect_test "line-by-line-incremental-small-4" = Appending chunk 22/22 @ 4:17-5:2 ("RUN.\n ") Parse-tree: IDENTIFICATION DIVISION. - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. @@ -899,7 +899,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 56/103 @ 3:22-3:24 ("g.") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 56/103 back @ 3:22-3:23 ("g") @@ -908,7 +908,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 57/103 @ 3:23-4:0 (".\n") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 57/103 back @ 3:23-3:24 (".") @@ -917,17 +917,17 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 58/103 @ 3:24-4:1 ("\n ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 58/103 back @ 3:24-4:0 ("\n") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 59/103 @ 4:0-4:2 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 59/103 back @ 4:0-4:1 (" ") @@ -936,12 +936,12 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 60/103 @ 4:1-4:3 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 60/103 back @ 4:1-4:2 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 61/103 @ 4:2-4:4 (" ") @@ -950,12 +950,12 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Cutting chunk 61/103 back @ 4:2-4:3 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 62/103 @ 4:3-4:5 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 62/103 back @ 4:3-4:4 (" ") @@ -964,12 +964,12 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 63/103 @ 4:4-4:6 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Cutting chunk 63/103 back @ 4:4-4:5 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 64/103 @ 4:5-4:7 (" ") @@ -978,7 +978,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Cutting chunk 64/103 back @ 4:5-4:6 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. Appending chunk 65/103 @ 4:6-4:8 (" P") @@ -1127,7 +1127,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 83/103 @ 4:24-4:26 ("N.") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1138,14 +1138,14 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 84/103 @ 4:25-5:0 (".\n") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 84/103 back @ 4:25-4:26 (".") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1156,28 +1156,28 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Cutting chunk 85/103 back @ 4:26-5:0 ("\n") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 86/103 @ 5:0-5:2 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 86/103 back @ 5:0-5:1 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 87/103 @ 5:1-5:3 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1188,28 +1188,28 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 88/103 @ 5:2-5:4 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 88/103 back @ 5:2-5:3 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 89/103 @ 5:3-5:5 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 89/103 back @ 5:3-5:4 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1220,28 +1220,28 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Cutting chunk 90/103 back @ 5:4-5:5 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 91/103 @ 5:5-5:7 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 91/103 back @ 5:5-5:6 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 92/103 @ 5:6-5:8 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1252,28 +1252,28 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 93/103 @ 5:7-5:9 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 93/103 back @ 5:7-5:8 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Appending chunk 94/103 @ 5:8-5:10 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. Cutting chunk 94/103 back @ 5:8-5:9 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1284,7 +1284,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Cutting chunk 95/103 back @ 5:9-5:10 (" ") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. @@ -1347,7 +1347,7 @@ let%expect_test "chunk-by-chunk-incremental-small-5" = Appending chunk 103/103 @ 5:17-5:19 ("N.") Parse-tree: - PROGRAM-ID. PROG. + PROGRAM-ID. prog. PROCEDURE DIVISION. STOP RUN. |}];; diff --git a/test/cobol_parsing/tokens.ml b/test/cobol_parsing/tokens.ml index 02ca79b65..410c11f05 100644 --- a/test/cobol_parsing/tokens.ml +++ b/test/cobol_parsing/tokens.ml @@ -20,7 +20,7 @@ let%expect_test "tokens" = STOP RUN. |}; [%expect {| - IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[PROG], ., PROCEDURE, + IDENTIFICATION, DIVISION, ., PROGRAM-ID, ., INFO_WORD[prog], ., PROCEDURE, DIVISION, ., STOP, RUN, ., EOF |}];; diff --git a/test/cobol_preprocessing/auto_sourceformat.ml b/test/cobol_preprocessing/auto_sourceformat.ml index e93829055..cd96c11ce 100644 --- a/test/cobol_preprocessing/auto_sourceformat.ml +++ b/test/cobol_preprocessing/auto_sourceformat.ml @@ -27,7 +27,7 @@ let%expect_test "auto-fixed-1" = Preproc_testing.preprocess ~source_format:Auto "\ \ IDENTIFICATION DIVISION. \ PROGRAM-ID. prog."; - [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . PROG . |}];; + [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . prog . |}];; let%expect_test "auto-fixed-2" = @@ -38,14 +38,14 @@ let%expect_test "auto-fixed-2" = \ \ IDENTIFICATION DIVISION. \ PROGRAM-ID. prog."; - [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . PROG . |}];; + [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . prog . |}];; let%expect_test "auto-free-1" = Preproc_testing.preprocess ~source_format:Auto "\ IDENTIFICATION DIVISION. PROGRAM-ID. prog."; - [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . PROG . |}];; + [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . prog . |}];; let%expect_test "auto-free-2" = @@ -53,7 +53,7 @@ let%expect_test "auto-free-2" = *> comment IDENTIFICATION DIVISION. PROGRAM-ID. prog."; - [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . PROG . |}];; + [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . prog . |}];; let%expect_test "auto-free-3" = @@ -62,7 +62,7 @@ let%expect_test "auto-free-3" = *> comment IDENTIFICATION DIVISION. PROGRAM-ID. prog."; - [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . PROG . |}];; + [%expect {| IDENTIFICATION DIVISION . PROGRAM-ID . prog . |}];; let%expect_test "auto-free-tab-only" = diff --git a/test/cobol_preprocessing/auto_sourceformat_rewind.ml b/test/cobol_preprocessing/auto_sourceformat_rewind.ml index 9da1d7847..9b4079b2d 100644 --- a/test/cobol_preprocessing/auto_sourceformat_rewind.ml +++ b/test/cobol_preprocessing/auto_sourceformat_rewind.ml @@ -39,11 +39,11 @@ let%expect_test "auto-fixed-1" = free: "IDENTIFICATION DIVISION." "PROGRAM-ID. prog." IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF + PROGRAM-ID . prog . EOF IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF + PROGRAM-ID . prog . EOF IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF |}];; + PROGRAM-ID . prog . EOF |}];; let%expect_test "auto-fixed-2" = @@ -62,8 +62,8 @@ let%expect_test "auto-fixed-2" = "IDENTIFICATION DIVISION." "PROGRAM-ID. prog." IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF + PROGRAM-ID . prog . EOF IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF + PROGRAM-ID . prog . EOF IDENTIFICATION DIVISION . - PROGRAM-ID . PROG . EOF |}];; + PROGRAM-ID . prog . EOF |}];; diff --git a/test/cobol_preprocessing/source_lines.ml b/test/cobol_preprocessing/source_lines.ml index e7d9893dd..bf6df04fb 100644 --- a/test/cobol_preprocessing/source_lines.ml +++ b/test/cobol_preprocessing/source_lines.ml @@ -48,7 +48,7 @@ $ SOURCE IS FREE >>SET SOURCEFORMAT "COBOLX" - $SOURCE FORMAT FREE + $Source format free >>SET SOURCEFORMAT "FIXED" @@ -92,7 +92,7 @@ $ SOURCE IS FREE 4: |new source format| 5: 6: - 7: $SOURCE FORMAT FREE + 7: $Source format free 7: |new source format| 8: 9: >>SET SOURCEFORMAT "FIXED" diff --git a/test/output-tests/preproc.expected b/test/output-tests/preproc.expected index 2102e858f..b1bbff796 100644 --- a/test/output-tests/preproc.expected +++ b/test/output-tests/preproc.expected @@ -4,12 +4,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/ACCEPT.CBL': . PROGRAM-ID . - ACCEPTANDDISPLAY + AcceptAndDisplay . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -18,56 +18,56 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/ACCEPT.CBL': SECTION . 01 - STUDENTDETAILS + StudentDetails . 02 - STUDENTID + StudentId PIC 9(7) . 02 - STUDENTNAME + StudentName . 03 - SURNAME + Surname PIC X(8) . 03 - INITIALS + Initials PIC XX . 02 - COURSECODE + CourseCode PIC X(4) . 02 - GENDER + Gender PIC X . 01 - CURRENTDATE + CurrentDate . 02 - CURRENTYEAR + CurrentYear PIC 9(4) . 02 - CURRENTMONTH + CurrentMonth PIC 99 . 02 - CURRENTDAY + CurrentDay PIC 99 . 01 - DAYOFYEAR + DayOfYear . 02 FILLER @@ -75,20 +75,20 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/ACCEPT.CBL': 9(4) . 02 - YEARDAY + YearDay PIC 9(3) . 01 - CURRENTTIME + CurrentTime . 02 - CURRENTHOUR + CurrentHour PIC 99 . 02 - CURRENTMINUTE + CurrentMinute PIC 99 . @@ -100,7 +100,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/ACCEPT.CBL': PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Enter student details using template below" @@ -111,49 +111,49 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/ACCEPT.CBL': "SSSSSSSNNNNNNNNIICCCCG" . ACCEPT - STUDENTDETAILS + StudentDetails . ACCEPT - CURRENTDATE + CurrentDate FROM DATE YYYYMMDD . ACCEPT - DAYOFYEAR + DayOfYear FROM DAY YYYYDDD . ACCEPT - CURRENTTIME + CurrentTime FROM TIME . DISPLAY "Name is " - INITIALS + Initials SPACE - SURNAME + Surname . DISPLAY "Date is " - CURRENTDAY + CurrentDay SPACE - CURRENTMONTH + CurrentMonth SPACE - CURRENTYEAR + CurrentYear . DISPLAY "Today is day " - YEARDAY + YearDay " of the year" . DISPLAY "The time is " - CURRENTHOUR + CurrentHour ":" - CURRENTMINUTE + CurrentMinute . STOP RUN @@ -166,12 +166,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/MULTIPLIER.CBL': . PROGRAM-ID . - MULTIPLIER + Multiplier . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -180,21 +180,21 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/MULTIPLIER.CBL': SECTION . 01 - NUM1 + Num1 PIC 9 VALUE ZEROS . 01 - NUM2 + Num2 PIC 9 VALUE ZEROS . 01 - RESULT + Result PIC 99 VALUE @@ -210,7 +210,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/MULTIPLIER.CBL': ADVANCING . ACCEPT - NUM1 + Num1 . DISPLAY "Enter second number (1 digit) : " @@ -219,18 +219,18 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/MULTIPLIER.CBL': ADVANCING . ACCEPT - NUM2 + Num2 . MULTIPLY - NUM1 + Num1 BY - NUM2 + Num2 GIVING - RESULT + Result . DISPLAY "Result is = " - RESULT + Result . STOP RUN @@ -243,12 +243,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Accept/Shortest.CBL': . PROGRAM-ID . - SHORTESTPROGRAM + ShortestProgram . PROCEDURE DIVISION . - DISPLAYPROMPT + DisplayPrompt . DISPLAY "I did it" @@ -264,12 +264,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/CONDITIONS.CBL' . PROGRAM-ID . - CONDITIONS + Conditions . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -278,12 +278,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/CONDITIONS.CBL' SECTION . 01 - CHAR + Char PIC X . 88 - VOWEL + Vowel VALUE "a" "e" @@ -292,7 +292,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/CONDITIONS.CBL' "u" . 88 - CONSONANT + Consonant VALUE "b" "c" @@ -311,14 +311,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/CONDITIONS.CBL' "z" . 88 - DIGIT + Digit VALUE "0" THRU "9" . 88 - VALIDCHARACTER + ValidCharacter VALUE "a" THRU @@ -330,36 +330,36 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/CONDITIONS.CBL' PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Enter lower case character or digit. No data ends." . ACCEPT - CHAR + Char . PERFORM UNTIL NOT - VALIDCHARACTER + ValidCharacter EVALUATE TRUE WHEN - VOWEL + Vowel DISPLAY "The letter " - CHAR + Char " is a vowel." WHEN - CONSONANT + Consonant DISPLAY "The letter " - CHAR + Char " is a consonant." WHEN - DIGIT + Digit DISPLAY - CHAR + Char " is a digit." WHEN OTHER @@ -378,12 +378,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/IterIf.cbl': . PROGRAM-ID . - ITERATION-IF + Iteration-If . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -392,28 +392,28 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/IterIf.cbl': SECTION . 01 - NUM1 + Num1 PIC 9 VALUE ZEROS . 01 - NUM2 + Num2 PIC 9 VALUE ZEROS . 01 - RESULT + Result PIC 99 VALUE ZEROS . 01 - OPERATOR + Operator PIC X VALUE @@ -422,7 +422,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/IterIf.cbl': PROCEDURE DIVISION . - CALCULATOR + Calculator . PERFORM 3 @@ -433,47 +433,47 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Conditn/IterIf.cbl': NO ADVANCING ACCEPT - NUM1 + Num1 DISPLAY "Enter Second Number : " WITH NO ADVANCING ACCEPT - NUM2 + Num2 DISPLAY "Enter operator (+ or *) : " WITH NO ADVANCING ACCEPT - OPERATOR + Operator IF - OPERATOR + Operator = "+" THEN ADD - NUM1 - NUM2 + Num1 + Num2 GIVING - RESULT + Result END-IF IF - OPERATOR + Operator = "*" THEN MULTIPLY - NUM1 + Num1 BY - NUM2 + Num2 GIVING - RESULT + Result END-IF DISPLAY "Result is = " - RESULT + Result END-PERFORM . STOP @@ -487,12 +487,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C . PROGRAM-ID . - DIRECTREADIDX + DirectReadIdx . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -503,7 +503,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C FILE-CONTROL . SELECT - VIDEOFILE + VideoFile ASSIGN TO "IDXVIDEO.DAT" @@ -517,18 +517,18 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C RECORD KEY IS - VIDEOCODE + VideoCode ALTERNATE RECORD KEY IS - VIDEOTITLE + VideoTitle WITH DUPLICATES FILE STATUS IS - VIDEOSTATUS + VideoStatus . DATA DIVISION @@ -537,23 +537,23 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C SECTION . FD - VIDEOFILE + VideoFile . 01 - VIDEORECORD + VideoRecord . 02 - VIDEOCODE + VideoCode PIC 9(5) . 02 - VIDEOTITLE + VideoTitle PIC X(40) . 02 - SUPPLIERCODE + SupplierCode PIC 99 . @@ -561,56 +561,56 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C SECTION . 01 - VIDEOSTATUS + VideoStatus PIC X(2) . 88 - RECORDFOUND + RecordFound VALUE "00" . 01 - REQUIREDKEY + RequiredKey PIC 9 . 88 - VIDEOCODEKEY + VideoCodeKey VALUE 1 . 88 - VIDEOTITLEKEY + VideoTitleKey VALUE 2 . 01 - PRNVIDEORECORD + PrnVideoRecord . 02 - PRNVIDEOCODE + PrnVideoCode PIC 9(5) . 02 - PRNVIDEOTITLE + PrnVideoTitle PIC BBBBX(40) . 02 - PRNSUPPLIERCODE + PrnSupplierCode PIC BBBB99 . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - VIDEOFILE + VideoFile . DISPLAY "Chose key VideoCode = 1, VideoTitle = 2 -> " @@ -619,70 +619,70 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/DirectReadIdx.C ADVANCING . ACCEPT - REQUIREDKEY + RequiredKey . IF - VIDEOCODEKEY + VideoCodeKey DISPLAY "Enter Video Code (5 digits) -> " WITH NO ADVANCING ACCEPT - VIDEOCODE + VideoCode READ - VIDEOFILE + VideoFile KEY IS - VIDEOCODE + VideoCode INVALID KEY DISPLAY "VIDEO STATUS :- " - VIDEOSTATUS + VideoStatus END-READ END-IF IF - VIDEOTITLEKEY + VideoTitleKey DISPLAY "Enter Video Title (40 chars) -> " WITH NO ADVANCING ACCEPT - VIDEOTITLE + VideoTitle READ - VIDEOFILE + VideoFile KEY IS - VIDEOTITLE + VideoTitle INVALID KEY DISPLAY "VIDEO STATUS :- " - VIDEOSTATUS + VideoStatus END-READ END-IF IF - RECORDFOUND + RecordFound MOVE - VIDEOCODE + VideoCode TO - PRNVIDEOCODE + PrnVideoCode MOVE - VIDEOTITLE + VideoTitle TO - PRNVIDEOTITLE + PrnVideoTitle MOVE - SUPPLIERCODE + SupplierCode TO - PRNSUPPLIERCODE + PrnSupplierCode DISPLAY - PRNVIDEORECORD + PrnVideoRecord END-IF . CLOSE - VIDEOFILE + VideoFile . STOP RUN @@ -695,12 +695,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/Seq2Index.CBL': . PROGRAM-ID . - SEQ2INDEX + Seq2Index . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -711,7 +711,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/Seq2Index.CBL': FILE-CONTROL . SELECT - VIDEOFILE + VideoFile ASSIGN TO "IDXVIDEO.DAT" @@ -725,21 +725,21 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/Seq2Index.CBL': RECORD KEY IS - VIDEOCODE + VideoCode ALTERNATE RECORD KEY IS - VIDEOTITLE + VideoTitle WITH DUPLICATES FILE STATUS IS - VIDEOSTATUS + VideoStatus . SELECT - SEQVIDEOFILE + SeqVideoFile ASSIGN TO "SEQVIDEO.DAT" @@ -755,49 +755,49 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/Seq2Index.CBL': SECTION . FD - VIDEOFILE + VideoFile . 01 - VIDEORECORD + VideoRecord . 02 - VIDEOCODE + VideoCode PIC 9(5) . 02 - VIDEOTITLE + VideoTitle PIC X(40) . 02 - VIDEOSUPPLIERCODE + VideoSupplierCode PIC 99 . FD - SEQVIDEOFILE + SeqVideoFile . 01 - SEQVIDEORECORD + SeqVideoRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - SEQVIDEOCODE + SeqVideoCode PIC 9(5) . 02 - SEQVIDEOTITLE + SeqVideoTitle PIC X(40) . 02 - SEQVIDEOSUPPLIERCODE + SeqVideoSupplierCode PIC 99 . @@ -805,60 +805,60 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/Seq2Index.CBL': SECTION . 01 - VIDEOSTATUS + VideoStatus PIC X(2) . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - SEQVIDEOFILE + SeqVideoFile . OPEN OUTPUT - VIDEOFILE + VideoFile . READ - SEQVIDEOFILE + SeqVideoFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . PERFORM UNTIL - ENDOFFILE + EndOfFile WRITE - VIDEORECORD + VideoRecord FROM - SEQVIDEORECORD + SeqVideoRecord INVALID KEY DISPLAY "VIDEO STATUS :- " - VIDEOSTATUS + VideoStatus END-WRITE READ - SEQVIDEOFILE + SeqVideoFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM . CLOSE - VIDEOFILE - SEQVIDEOFILE + VideoFile + SeqVideoFile . STOP RUN @@ -871,12 +871,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' . PROGRAM-ID . - SEQREADIDX + SeqReadIdx . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -887,7 +887,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' FILE-CONTROL . SELECT - VIDEOFILE + VideoFile ASSIGN TO "IDXVIDEO.DAT" @@ -901,18 +901,18 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' RECORD KEY IS - VIDEOCODE + VideoCode ALTERNATE RECORD KEY IS - VIDEOTITLE + VideoTitle WITH DUPLICATES FILE STATUS IS - VIDEOSTATUS + VideoStatus . DATA DIVISION @@ -921,28 +921,28 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' SECTION . FD - VIDEOFILE + VideoFile . 01 - VIDEORECORD + VideoRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUE . 02 - VIDEOCODE + VideoCode PIC 9(5) . 02 - VIDEOTITLE + VideoTitle PIC X(40) . 02 - SUPPLIERCODE + SupplierCode PIC 99 . @@ -950,51 +950,51 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' SECTION . 01 - VIDEOSTATUS + VideoStatus PIC X(2) . 01 - REQUIREDSEQUENCE + RequiredSequence PIC 9 . 88 - VIDEOCODESEQUENCE + VideoCodeSequence VALUE 1 . 88 - VIDEOTITLESEQUENCE + VideoTitleSequence VALUE 2 . 01 - PRNVIDEORECORD + PrnVideoRecord . 02 - PRNVIDEOCODE + PrnVideoCode PIC 9(5) . 02 - PRNVIDEOTITLE + PrnVideoTitle PIC BBBBX(40) . 02 - PRNSUPPLIERCODE + PrnSupplierCode PIC BBBB99 . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - VIDEOFILE + VideoFile . DISPLAY "Enter key : 1=VideoCode, 2=VideoTitle ->" @@ -1003,72 +1003,72 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Indexed/SeqReadIdx.cbl' ADVANCING . ACCEPT - REQUIREDSEQUENCE + RequiredSequence . IF - VIDEOTITLESEQUENCE + VideoTitleSequence MOVE SPACES TO - VIDEOTITLE + VideoTitle START - VIDEOFILE + VideoFile KEY IS GREATER THAN - VIDEOTITLE + VideoTitle INVALID KEY DISPLAY "VIDEO STATUS :- " - VIDEOSTATUS + VideoStatus END-START END-IF READ - VIDEOFILE + VideoFile NEXT RECORD AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . PERFORM UNTIL - ENDOFFILE + EndOfFile MOVE - VIDEOCODE + VideoCode TO - PRNVIDEOCODE + PrnVideoCode MOVE - VIDEOTITLE + VideoTitle TO - PRNVIDEOTITLE + PrnVideoTitle MOVE - SUPPLIERCODE + SupplierCode TO - PRNSUPPLIERCODE + PrnSupplierCode DISPLAY - PRNVIDEORECORD + PrnVideoRecord READ - VIDEOFILE + VideoFile NEXT RECORD AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM . CLOSE - VIDEOFILE + VideoFile . STOP RUN @@ -1081,7 +1081,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': . PROGRAM-ID . - MERGEFILES + MergeFiles . AUTHOR . @@ -1097,7 +1097,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -1107,7 +1107,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': SEQUENTIAL . SELECT - INSERTIONSFILE + InsertionsFile ASSIGN TO "TRANSINS.DAT" @@ -1117,7 +1117,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': SEQUENTIAL . SELECT - NEWSTUDENTFILE + NewStudentFile ASSIGN TO "STUDENTS.NEW" @@ -1127,7 +1127,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': SEQUENTIAL . SELECT - WORKFILE + WorkFile ASSIGN TO "WORK.TMP" @@ -1139,37 +1139,37 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTREC + StudentRec PIC X(30) . FD - INSERTIONSFILE + InsertionsFile . 01 - INSERTIONREC + InsertionRec PIC X(30) . FD - NEWSTUDENTFILE + NewStudentFile . 01 - NEWSTUDENTREC + NewStudentRec PIC X(30) . SD - WORKFILE + WorkFile . 01 - WORKREC + WorkRec . 02 - WSTUDENTID + WStudentId PIC 9(7) . @@ -1181,19 +1181,19 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Merge/MERGE.CBL': PROCEDURE DIVISION . - BEGIN + Begin . MERGE - WORKFILE + WorkFile ON ASCENDING KEY - WSTUDENTID + WStudentId USING - INSERTIONSFILE - STUDENTFILE + InsertionsFile + StudentFile GIVING - NEWSTUDENTFILE + NewStudentFile . STOP RUN @@ -1206,12 +1206,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/MileageCount.CB . PROGRAM-ID . - MILEAGECOUNTER + MileageCounter . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -1220,51 +1220,51 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/MileageCount.CB SECTION . 01 - COUNTERS + Counters . 02 - HUNDREDSCOUNT + HundredsCount PIC 99 VALUE ZEROS . 02 - TENSCOUNT + TensCount PIC 99 VALUE ZEROS . 02 - UNITSCOUNT + UnitsCount PIC 99 VALUE ZEROS . 01 - DISPLAYITEMS + DisplayItems . 02 - PRNHUNDS + PrnHunds PIC 9 . 02 - PRNTENS + PrnTens PIC 9 . 02 - PRNUNITS + PrnUnits PIC 9 . PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Using an out-of-line Perform" @@ -1273,35 +1273,35 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/MileageCount.CB "About to start mileage counter simulation" . PERFORM - COUNTMILAGE + CountMilage VARYING - HUNDREDSCOUNT + HundredsCount FROM 0 BY 1 UNTIL - HUNDREDSCOUNT + HundredsCount > 9 AFTER - TENSCOUNT + TensCount FROM 0 BY 1 UNTIL - TENSCOUNT + TensCount > 9 AFTER - UNITSCOUNT + UnitsCount FROM 0 BY 1 UNTIL - UNITSCOUNT + UnitsCount > 9 DISPLAY @@ -1313,55 +1313,55 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/MileageCount.CB . PERFORM VARYING - HUNDREDSCOUNT + HundredsCount FROM 0 BY 1 UNTIL - HUNDREDSCOUNT + HundredsCount > 9 PERFORM VARYING - TENSCOUNT + TensCount FROM 0 BY 1 UNTIL - TENSCOUNT + TensCount > 9 PERFORM VARYING - UNITSCOUNT + UnitsCount FROM 0 BY 1 UNTIL - UNITSCOUNT + UnitsCount > 9 MOVE - HUNDREDSCOUNT + HundredsCount TO - PRNHUNDS + PrnHunds MOVE - TENSCOUNT + TensCount TO - PRNTENS + PrnTens MOVE - UNITSCOUNT + UnitsCount TO - PRNUNITS + PrnUnits DISPLAY - PRNHUNDS + PrnHunds "-" - PRNTENS + PrnTens "-" - PRNUNITS + PrnUnits END-PERFORM END-PERFORM END-PERFORM @@ -1371,26 +1371,26 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/MileageCount.CB STOP RUN . - COUNTMILAGE + CountMilage . MOVE - HUNDREDSCOUNT + HundredsCount TO - PRNHUNDS + PrnHunds MOVE - TENSCOUNT + TensCount TO - PRNTENS + PrnTens MOVE - UNITSCOUNT + UnitsCount TO - PRNUNITS + PrnUnits DISPLAY - PRNHUNDS + PrnHunds "-" - PRNTENS + PrnTens "-" - PRNUNITS + PrnUnits . Done. @@ -1400,48 +1400,48 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM1.CBL': . PROGRAM-ID . - PERFORMFORMAT1 + PerformFormat1 . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . PROCEDURE DIVISION . - TOPLEVEL + TopLevel . DISPLAY "In TopLevel. Starting to run program" PERFORM - ONELEVELDOWN + OneLevelDown DISPLAY "Back in TopLevel." . STOP RUN . - TWOLEVELSDOWN + TwoLevelsDown . DISPLAY ">>>>>>>> Now in TwoLevelsDown." PERFORM - THREELEVELSDOWN + ThreeLevelsDown . DISPLAY ">>>>>>>> Back in TwoLevelsDown." . - ONELEVELDOWN + OneLevelDown . DISPLAY ">>>> Now in OneLevelDown" PERFORM - TWOLEVELSDOWN + TwoLevelsDown DISPLAY ">>>> Back in OneLevelDown" . - THREELEVELSDOWN + ThreeLevelsDown . DISPLAY ">>>>>>>>>>>> Now in ThreeLevelsDown" @@ -1454,12 +1454,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM3.CBL': . PROGRAM-ID . - PERFORMFORMAT3 + PerformFormat3 . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -1468,38 +1468,38 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM3.CBL': SECTION . 01 - ITERCOUNT + IterCount PIC 99 VALUE ZEROS . 88 - MAXCOUNTREACHED + MaxCountReached VALUE 99 . 01 - USERINPUT + UserInput PIC 99 VALUE ZEROS . 88 - ENDOFUSERINPUT + EndOfUserInput VALUE ZEROS . 01 - RUNNINGTOTAL + RunningTotal PIC 999 VALUE ZEROS . 01 - AVERAGEVALUE + AverageValue PIC 99 VALUES @@ -1508,25 +1508,25 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM3.CBL': PROCEDURE DIVISION . - BEGIN + Begin . PERFORM UNTIL - ITERCOUNT + IterCount = 5 DISPLAY "IterCount = " - ITERCOUNT + IterCount ADD 1 TO - ITERCOUNT + IterCount END-PERFORM DISPLAY "Finished in line Perform." INITIALIZE - ITERCOUNT + Itercount DISPLAY "Enter a stream of up to 99 numbers." DISPLAY @@ -1537,37 +1537,37 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM3.CBL': NO ADVANCING ACCEPT - USERINPUT + UserInput PERFORM - GETUSERINPUT + GetUserInput UNTIL - ENDOFUSERINPUT + EndOfUserInput OR - MAXCOUNTREACHED + MaxCountReached DISPLAY "The final total is - " - RUNNINGTOTAL + RunningTotal DISPLAY "The final count is - " - ITERCOUNT + IterCount COMPUTE - AVERAGEVALUE + AverageValue = - RUNNINGTOTAL + RunningTotal / - ITERCOUNT + IterCount DISPLAY "The average value entered is - " - AVERAGEVALUE + AverageValue STOP RUN . - GETUSERINPUT + GetUserInput . ADD - USERINPUT + UserInput TO - RUNNINGTOTAL + RunningTotal ON SIZE ERROR @@ -1580,22 +1580,22 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM3.CBL': ADD 1 TO - ITERCOUNT + IterCount END-ADD END-ADD DISPLAY "Total so far is - " - RUNNINGTOTAL + RunningTotal DISPLAY "Count so far is - " - ITERCOUNT + IterCount DISPLAY "Enter number :- " WITH NO ADVANCING ACCEPT - USERINPUT + UserInput . Done. @@ -1605,12 +1605,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': . PROGRAM-ID . - PERFORMFORMAT4 + PerformFormat4 . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -1619,14 +1619,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': SECTION . 01 - LOOPCOUNT + LoopCount PIC 9 VALUE ZEROS . 01 - LOOPCOUNT2 + LoopCount2 PIC S9 VALUE @@ -1635,77 +1635,77 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Start WHILE Iteration of LoopBody" PERFORM - LOOPBODY + LoopBody WITH TEST BEFORE VARYING - LOOPCOUNT + LoopCount FROM 1 BY 2 UNTIL - LOOPCOUNT + LoopCount GREATER THAN 5 . DISPLAY "Finished WHILE iteration. LoopCount = " - LOOPCOUNT + LoopCount . DISPLAY "Start REPEAT Iteration of LoopBody" PERFORM - LOOPBODY + LoopBody WITH TEST AFTER VARYING - LOOPCOUNT + LoopCount FROM 1 BY 2 UNTIL - LOOPCOUNT + LoopCount GREATER THAN 5 . DISPLAY "Finished REPEAT iteration. LoopCount = " - LOOPCOUNT + LoopCount . DISPLAY "Start inline loops" PERFORM VARYING - LOOPCOUNT + LoopCount FROM 1 BY 1 UNTIL - LOOPCOUNT + LoopCount GREATER THAN 4 PERFORM VARYING - LOOPCOUNT2 + LoopCount2 FROM 5 BY -2 UNTIL - LOOPCOUNT2 + LoopCount2 LESS THAN ZERO @@ -1716,9 +1716,9 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': ADVANCING DISPLAY "LoopCount = " - LOOPCOUNT + LoopCount " LoopCount2 = " - LOOPCOUNT2 + LoopCount2 END-PERFORM END-PERFORM . @@ -1729,26 +1729,26 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': "Start PERFORM VARYING..AFTER" . PERFORM - LOOPBODY + LoopBody VARYING - LOOPCOUNT + LoopCount FROM 1 BY 1 UNTIL - LOOPCOUNT + LoopCount GREATER THAN 4 AFTER - LOOPCOUNT2 + LoopCount2 FROM 5 BY -2 UNTIL - LOOPCOUNT2 + LoopCount2 LESS THAN ZERO @@ -1759,7 +1759,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': STOP RUN . - LOOPBODY + LoopBody . DISPLAY "LoopBody " @@ -1768,9 +1768,9 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Perform/PERFORM4.CBL': ADVANCING DISPLAY "LoopCount = " - LOOPCOUNT + LoopCount " LoopCount2 = " - LOOPCOUNT2 + LoopCount2 . Done. @@ -1780,7 +1780,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': . PROGRAM-ID . - READRELATIVE + ReadRelative . AUTHOR . @@ -1796,7 +1796,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': FILE-CONTROL . SELECT - SUPPLIERFILE + SupplierFile ASSIGN TO "RELSUPP.DAT" @@ -1810,11 +1810,11 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': RELATIVE KEY IS - SUPPLIERKEY + SupplierKey FILE STATUS IS - SUPPLIERSTATUS + Supplierstatus . DATA DIVISION @@ -1823,28 +1823,28 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': SECTION . FD - SUPPLIERFILE + SupplierFile . 01 - SUPPLIERRECORD + SupplierRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - SUPPLIERCODE + SupplierCode PIC 99 . 02 - SUPPLIERNAME + SupplierName PIC X(20) . 02 - SUPPLIERADDRESS + SupplierAddress PIC X(50) . @@ -1852,50 +1852,50 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': SECTION . 01 - SUPPLIERSTATUS + SupplierStatus PIC X(2) . 88 - RECORDFOUND + RecordFound VALUE "00" . 01 - SUPPLIERKEY + SupplierKey PIC 99 . 01 - PRNSUPPLIERRECORD + PrnSupplierRecord . 02 - PRNSUPPLIERCODE + PrnSupplierCode PIC BB99 . 02 - PRNSUPPLIERNAME + PrnSupplierName PIC BBX(20) . 02 - PRNSUPPLIERADDRESS + PrnSupplierAddress PIC BBX(50) . 01 - READTYPE + ReadType PIC 9 . 88 - DIRECTREAD + DirectRead VALUE 1 . 88 - SEQUENTIALREAD + SequentialRead VALUE 2 . @@ -1906,7 +1906,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': . OPEN INPUT - SUPPLIERFILE + SupplierFile . DISPLAY "Read type : Direct read = 1, Sequential read = 2 --> " @@ -1915,83 +1915,83 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/ReadREL.CBL': ADVANCING . ACCEPT - READTYPE + ReadType . IF - DIRECTREAD + DirectRead DISPLAY "Enter supplier code key (2 digits) --> " WITH NO ADVANCING ACCEPT - SUPPLIERKEY + SupplierKey READ - SUPPLIERFILE + SupplierFile INVALID KEY DISPLAY "SUPP STATUS :-" - SUPPLIERSTATUS + SupplierStatus END-READ PERFORM - DISPLAYRECORD + DisplayRecord END-IF IF - SEQUENTIALREAD + SequentialRead READ - SUPPLIERFILE + SupplierFile NEXT RECORD AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ PERFORM UNTIL - ENDOFFILE + EndOfFile PERFORM - DISPLAYRECORD + DisplayRecord READ - SUPPLIERFILE + SupplierFile NEXT RECORD AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM END-IF CLOSE - SUPPLIERFILE + SupplierFile . STOP RUN . - DISPLAYRECORD + DisplayRecord . IF - RECORDFOUND + RecordFound MOVE - SUPPLIERCODE + SupplierCode TO - PRNSUPPLIERCODE + PrnSupplierCode MOVE - SUPPLIERNAME + SupplierName TO - PRNSUPPLIERNAME + PrnSupplierName MOVE - SUPPLIERADDRESS + SupplierAddress TO - PRNSUPPLIERADDRESS + PrnSupplierAddress DISPLAY - PRNSUPPLIERRECORD + PrnSupplierRecord END-IF . @@ -2002,7 +2002,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/Seq2Rel.cbl': . PROGRAM-ID . - SEQ2REL + Seq2Rel . AUTHOR . @@ -2018,7 +2018,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/Seq2Rel.cbl': FILE-CONTROL . SELECT - SUPPLIERFILE + SupplierFile ASSIGN TO "RELSUPP.DAT" @@ -2032,14 +2032,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/Seq2Rel.cbl': RELATIVE KEY IS - SUPPLIERKEY + SupplierKey FILE STATUS IS - SUPPLIERSTATUS + Supplierstatus . SELECT - SUPPLIERFILESEQ + SupplierFileSeq ASSIGN TO "SEQSUPP.DAT" @@ -2055,49 +2055,49 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/Seq2Rel.cbl': SECTION . FD - SUPPLIERFILE + SupplierFile . 01 - SUPPLIERRECORD + SupplierRecord . 02 - SUPPLIERCODE + SupplierCode PIC 99 . 02 - SUPPLIERNAME + SupplierName PIC X(20) . 02 - SUPPLIERADDRESS + SupplierAddress PIC X(50) . FD - SUPPLIERFILESEQ + SupplierFileSeq . 01 - SUPPLIERRECORDSEQ + SupplierRecordSeq . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - SUPPLIERCODESEQ + SupplierCodeSeq PIC 99 . 02 - SUPPLIERNAMESEQ + SupplierNameSeq PIC X(20) . 02 - SUPPLIERADDRESSSEQ + SupplierAddressSeq PIC X(50) . @@ -2105,70 +2105,70 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Relative/Seq2Rel.cbl': SECTION . 01 - SUPPLIERSTATUS + SupplierStatus PIC X(2) . 01 - SUPPLIERKEY + SupplierKey PIC 99 . PROCEDURE DIVISION . - BEGIN + Begin . OPEN OUTPUT - SUPPLIERFILE + SupplierFile . OPEN INPUT - SUPPLIERFILESEQ + SupplierFileSeq . READ - SUPPLIERFILESEQ + SupplierFileSeq AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ PERFORM UNTIL - ENDOFFILE + EndOfFile MOVE - SUPPLIERCODESEQ + SupplierCodeSeq TO - SUPPLIERKEY + SupplierKey MOVE - SUPPLIERRECORDSEQ + SupplierRecordSeq TO - SUPPLIERRECORD + SupplierRecord WRITE - SUPPLIERRECORD + SupplierRecord INVALID KEY DISPLAY "Supplier status = " - SUPPLIERSTATUS + SupplierStatus END-WRITE READ - SUPPLIERFILESEQ + SupplierFileSeq AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM . CLOSE - SUPPLIERFILE - SUPPLIERFILESEQ + SupplierFile + SupplierFileSeq . STOP RUN @@ -2181,12 +2181,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. . PROGRAM-ID . - REPORTEXAMPLEA + ReportExampleA . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -2197,7 +2197,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. FILE-CONTROL . SELECT - SALESFILE + SalesFile ASSIGN TO "GBSALES.DAT" @@ -2207,7 +2207,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. SEQUENTIAL . SELECT - PRINTFILE + PrintFile ASSIGN TO "SALESREPORTA.LPT" @@ -2219,45 +2219,45 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. SECTION . FD - SALESFILE + SalesFile . 01 - SALESRECORD + SalesRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - CITYCODE + CityCode PIC 9 . 02 - SALESPERSONNUM + SalesPersonNum PIC 9 . 02 - VALUEOFSALE + ValueOfSale PIC 9(4)V99 . FD - PRINTFILE + PrintFile REPORT IS - SALESREPORT + SalesReport . WORKING-STORAGE SECTION . 01 - NAMETABLE + NameTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -2290,10 +2290,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITYNAME + CityName PIC X(9) OCCURS @@ -2304,10 +2304,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. SECTION . RD - SALESREPORT + SalesReport CONTROLS ARE - SALESPERSONNUM + SalesPersonNum PAGE LIMIT IS @@ -2418,7 +2418,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. "Value" . 01 - DETAILLINE + DetailLine TYPE IS DETAIL @@ -2435,7 +2435,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) . 03 COLUMN @@ -2443,7 +2443,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 03 COLUMN @@ -2451,15 +2451,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PIC $$,$$$.99 SOURCE - VALUEOFSALE + ValueOfSale . 01 - SALESPERSONGRP + SalesPersonGrp TYPE IS CONTROL FOOTING - SALESPERSONNUM + SalesPersonNum NEXT GROUP PLUS @@ -2485,7 +2485,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 03 COLUMN @@ -2502,7 +2502,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PIC $$$$$,$$$.99 SUM - VALUEOFSALE + ValueOfSale . 01 TYPE @@ -2542,55 +2542,55 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteA. PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - SALESFILE + SalesFile . OPEN OUTPUT - PRINTFILE + PrintFile . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . INITIATE - SALESREPORT + SalesReport . PERFORM - PRINTSALARYREPORT + PrintSalaryReport UNTIL - ENDOFFILE + EndOfFile . TERMINATE - SALESREPORT + SalesReport . CLOSE - SALESFILE - PRINTFILE + SalesFile + PrintFile . STOP RUN . - PRINTSALARYREPORT + PrintSalaryReport . GENERATE - DETAILLINE + DetailLine . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ @@ -2603,12 +2603,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. . PROGRAM-ID . - REPORTEXAMPLEB + ReportExampleB . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -2619,7 +2619,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. FILE-CONTROL . SELECT - SALESFILE + SalesFile ASSIGN TO "GBSALES.DAT" @@ -2629,7 +2629,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. SEQUENTIAL . SELECT - PRINTFILE + PrintFile ASSIGN TO "SALESREPORTB.LPT" @@ -2641,45 +2641,45 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. SECTION . FD - SALESFILE + SalesFile . 01 - SALESRECORD + SalesRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - CITYCODE + CityCode PIC 9 . 02 - SALESPERSONNUM + SalesPersonNum PIC 9 . 02 - VALUEOFSALE + ValueOfSale PIC 9(4)V99 . FD - PRINTFILE + PrintFile REPORT IS - SALESREPORT + SalesReport . WORKING-STORAGE SECTION . 01 - NAMETABLE + NameTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -2712,10 +2712,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITYNAME + CityName PIC X(9) OCCURS @@ -2726,12 +2726,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. SECTION . RD - SALESREPORT + SalesReport CONTROLS ARE FINAL - CITYCODE - SALESPERSONNUM + CityCode + SalesPersonNum PAGE LIMIT IS @@ -2842,7 +2842,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. "Value" . 01 - DETAILLINE + DetailLine TYPE IS DETAIL @@ -2859,7 +2859,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) GROUP INDICATE . @@ -2869,7 +2869,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum GROUP INDICATE . @@ -2879,15 +2879,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC $$,$$$.99 SOURCE - VALUEOFSALE + ValueOfSale . 01 - SALESPERSONGRP + SalesPersonGrp TYPE IS CONTROL FOOTING - SALESPERSONNUM + SalesPersonNum NEXT GROUP PLUS @@ -2913,7 +2913,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 03 COLUMN @@ -2930,15 +2930,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC $$$$$,$$$.99 SUM - VALUEOFSALE + ValueOfSale . 01 - CITYGRP + CityGrp TYPE IS CONTROL FOOTING - CITYCODE + CityCode NEXT GROUP PLUS @@ -2964,7 +2964,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) . 03 COLUMN @@ -2984,7 +2984,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. SMS . 01 - TOTALSALESGRP + TotalSalesGrp TYPE IS CONTROL @@ -3059,55 +3059,55 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteB. PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - SALESFILE + SalesFile . OPEN OUTPUT - PRINTFILE + PrintFile . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . INITIATE - SALESREPORT + SalesReport . PERFORM - PRINTSALARYREPORT + PrintSalaryReport UNTIL - ENDOFFILE + EndOfFile . TERMINATE - SALESREPORT + SalesReport . CLOSE - SALESFILE - PRINTFILE + SalesFile + PrintFile . STOP RUN . - PRINTSALARYREPORT + PrintSalaryReport . GENERATE - DETAILLINE + DetailLine . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ @@ -3120,12 +3120,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu . PROGRAM-ID . - REPORTEXAMPLEFULL + ReportExampleFull . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -3136,7 +3136,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu FILE-CONTROL . SELECT - SALESFILE + SalesFile ASSIGN TO "GBSALES.DAT" @@ -3146,7 +3146,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu SEQUENTIAL . SELECT - PRINTFILE + PrintFile ASSIGN TO "SALESREPORT.LPT" @@ -3158,45 +3158,45 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu SECTION . FD - SALESFILE + SalesFile . 01 - SALESRECORD + SalesRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - CITYCODE + CityCode PIC 9 . 02 - SALESPERSONNUM + SalesPersonNum PIC 9 . 02 - VALUEOFSALE + ValueOfSale PIC 9(4)V99 . FD - PRINTFILE + PrintFile REPORT IS - SALESREPORT + SalesReport . WORKING-STORAGE SECTION . 01 - NAMETABLE + NameTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -3229,10 +3229,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITYNAME + CityName PIC X(9) OCCURS @@ -3240,10 +3240,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu TIMES . 01 - RATETABLE + RateTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -3311,16 +3311,16 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITY + City OCCURS 7 TIMES . 04 - FIXEDRATE + FixedRate PIC 9(3)V99 OCCURS @@ -3328,32 +3328,32 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu TIMES . 01 - MISCVARIABLES + MiscVariables . 02 - COMMISSION + Commission PIC 9(4)V99 . 02 - PERCENTAGE + Percentage PIC V99 VALUE .05 . 02 - SALARY + Salary PIC 9(6)V99 . 02 - SALESPERSONNOW + SalesPersonNow PIC 9 . 02 - CITYNOW + CityNow PIC 9 . @@ -3361,12 +3361,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu SECTION . RD - SALESREPORT + SalesReport CONTROLS ARE FINAL - CITYCODE - SALESPERSONNUM + CityCode + SalesPersonNum PAGE LIMIT IS @@ -3477,7 +3477,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu "Value" . 01 - DETAILLINE + DetailLine TYPE IS DETAIL @@ -3494,7 +3494,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) GROUP INDICATE . @@ -3504,7 +3504,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum GROUP INDICATE . @@ -3514,15 +3514,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC $$,$$$.99 SOURCE - VALUEOFSALE + ValueOfSale . 01 - SALESPERSONGRP + SalesPersonGrp TYPE IS CONTROL FOOTING - SALESPERSONNUM + SalesPersonNum NEXT GROUP PLUS @@ -3548,7 +3548,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 03 COLUMN @@ -3565,7 +3565,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC $$$$$,$$$.99 SUM - VALUEOFSALE + ValueOfSale . 02 LINE @@ -3595,7 +3595,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC $$$$$,$$$.99 SOURCE - COMMISSION + Commission . 02 LINE @@ -3625,7 +3625,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC $$$$$,$$$.99 SOURCE - SALARY + Salary . 02 LINE @@ -3647,7 +3647,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - SALESPERSONNOW + SalesPersonNow . 02 LINE @@ -3669,15 +3669,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 01 - CITYGRP + CityGrp TYPE IS CONTROL FOOTING - CITYCODE + CityCode NEXT GROUP PLUS @@ -3703,7 +3703,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) . 03 COLUMN @@ -3750,7 +3750,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - CITYNOW + CityNow . 02 LINE @@ -3780,10 +3780,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu PIC 9 SOURCE - CITYCODE + CityCode . 01 - TOTALSALESGRP + TotalSalesGrp TYPE IS CONTROL @@ -3860,96 +3860,96 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteFu . DECLARATIVES . - CALC + Calc SECTION . USE BEFORE REPORTING - SALESPERSONGRP + SalesPersonGrp . - CALCULATE-SALARY + Calculate-Salary . MULTIPLY SMS BY - PERCENTAGE + Percentage GIVING - COMMISSION + Commission ROUNDED . ADD - COMMISSION - FIXEDRATE(CITYCODE,SALESPERSONNUM + Commission + FixedRate(CityCode,SalesPersonNum ) GIVING - SALARY + Salary . END DECLARATIVES . - MAIN + Main SECTION . - BEGIN + Begin . OPEN INPUT - SALESFILE + SalesFile . OPEN OUTPUT - PRINTFILE + PrintFile . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . INITIATE - SALESREPORT + SalesReport . PERFORM - PRINTSALARYREPORT + PrintSalaryReport UNTIL - ENDOFFILE + EndOfFile . TERMINATE - SALESREPORT + SalesReport . CLOSE - SALESFILE - PRINTFILE + SalesFile + PrintFile . STOP RUN . - PRINTSALARYREPORT + PrintSalaryReport . MOVE - CITYCODE + CityCode TO - CITYNOW + CityNow . MOVE - SALESPERSONNUM + SalesPersonNum TO - SALESPERSONNOW + SalesPersonNow . GENERATE - DETAILLINE + DetailLine . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ @@ -3962,12 +3962,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu . PROGRAM-ID . - REPORTEXAMPLESUMMARY + ReportExampleSummary . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -3978,7 +3978,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu FILE-CONTROL . SELECT - SALESFILE + SalesFile ASSIGN TO "GBSALES.DAT" @@ -3988,7 +3988,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu SEQUENTIAL . SELECT - PRINTFILE + PrintFile ASSIGN TO "SUMMARYSALESREPORT.LPT" @@ -4000,45 +4000,45 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu SECTION . FD - SALESFILE + SalesFile . 01 - SALESRECORD + SalesRecord . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - CITYCODE + CityCode PIC 9 . 02 - SALESPERSONNUM + SalesPersonNum PIC 9 . 02 - VALUEOFSALE + ValueOfSale PIC 9(4)V99 . FD - PRINTFILE + PrintFile REPORT IS - SALESREPORT + SalesReport . WORKING-STORAGE SECTION . 01 - NAMETABLE + NameTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -4071,10 +4071,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITYNAME + CityName PIC X(9) OCCURS @@ -4082,10 +4082,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu TIMES . 01 - RATETABLE + RateTable . 02 - TABLEVALUES + TableValues . 03 FILLER @@ -4153,16 +4153,16 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - CITY + City OCCURS 7 TIMES . 04 - FIXEDRATE + FixedRate PIC 9(3)V99 OCCURS @@ -4170,32 +4170,32 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu TIMES . 01 - MISCVARIABLES + MiscVariables . 02 - COMMISSION + Commission PIC 9(4)V99 . 02 - PERCENTAGE + Percentage PIC V99 VALUE .05 . 02 - SALARY + Salary PIC 9(6)V99 . 02 - SALESPERSONNOW + SalesPersonNow PIC 9 . 02 - CITYNOW + CityNow PIC 9 . @@ -4203,12 +4203,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu SECTION . RD - SALESREPORT + SalesReport CONTROLS ARE FINAL - CITYCODE - SALESPERSONNUM + CityCode + SalesPersonNum PAGE LIMIT IS @@ -4319,7 +4319,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu "Value" . 01 - DETAILLINE + DetailLine TYPE IS DETAIL @@ -4336,7 +4336,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) GROUP INDICATE . @@ -4346,7 +4346,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum GROUP INDICATE . @@ -4356,15 +4356,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC $$,$$$.99 SOURCE - VALUEOFSALE + ValueOfSale . 01 - SALESPERSONGRP + SalesPersonGrp TYPE IS CONTROL FOOTING - SALESPERSONNUM + SalesPersonNum NEXT GROUP PLUS @@ -4390,7 +4390,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 03 COLUMN @@ -4407,7 +4407,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC $$$$$,$$$.99 SUM - VALUEOFSALE + ValueOfSale . 02 LINE @@ -4437,7 +4437,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC $$$$$,$$$.99 SOURCE - COMMISSION + Commission . 02 LINE @@ -4467,7 +4467,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC $$$$$,$$$.99 SOURCE - SALARY + Salary . 02 LINE @@ -4489,7 +4489,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - SALESPERSONNOW + SalesPersonNow . 02 LINE @@ -4511,15 +4511,15 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - SALESPERSONNUM + SalesPersonNum . 01 - CITYGRP + CityGrp TYPE IS CONTROL FOOTING - CITYCODE + CityCode NEXT GROUP PLUS @@ -4545,7 +4545,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC X(9) SOURCE - CITYNAME(CITYCODE) + CityName(CityCode) . 03 COLUMN @@ -4592,7 +4592,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - CITYNOW + CityNow . 02 LINE @@ -4622,10 +4622,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu PIC 9 SOURCE - CITYCODE + CityCode . 01 - TOTALSALESGRP + TotalSalesGrp TYPE IS CONTROL @@ -4702,96 +4702,96 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/ReportWriter/RepWriteSu . DECLARATIVES . - CALC + Calc SECTION . USE BEFORE REPORTING - SALESPERSONGRP + SalesPersonGrp . - CALCULATE-SALARY + Calculate-Salary . MULTIPLY SMS BY - PERCENTAGE + Percentage GIVING - COMMISSION + Commission ROUNDED . ADD - COMMISSION - FIXEDRATE(CITYCODE,SALESPERSONNUM + Commission + FixedRate(CityCode,SalesPersonNum ) GIVING - SALARY + Salary . END DECLARATIVES . - MAIN + Main SECTION . - BEGIN + Begin . OPEN INPUT - SALESFILE + SalesFile . OPEN OUTPUT - PRINTFILE + PrintFile . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ . INITIATE - SALESREPORT + SalesReport . PERFORM - PRINTSALARYREPORT + PrintSalaryReport UNTIL - ENDOFFILE + EndOfFile . TERMINATE - SALESREPORT + SalesReport . CLOSE - SALESFILE - PRINTFILE + SalesFile + PrintFile . STOP RUN . - PRINTSALARYREPORT + PrintSalaryReport . MOVE - CITYCODE + CityCode TO - CITYNOW + CityNow . MOVE - SALESPERSONNUM + SalesPersonNum TO - SALESPERSONNOW + SalesPersonNow . GENERATE - SALESREPORT + SalesReport . READ - SALESFILE + SalesFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ @@ -4804,12 +4804,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': . PROGRAM-ID . - INSERTRECORDS + InsertRecords . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -4820,7 +4820,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': FILE-CONTROL . SELECT - STUDENTRECORDS + StudentRecords ASSIGN "STUDENTS.DAT" ORGANIZATION @@ -4833,7 +4833,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': SEQUENTIAL . SELECT - TRANSRECORDS + TransRecords ASSIGN "TRANSINS.DAT" ORGANIZATION @@ -4846,7 +4846,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': SEQUENTIAL . SELECT - NEWSTUDENTRECORDS + NewStudentRecords ASSIGN "STUDENTS.NEW" ORGANIZATION @@ -4865,18 +4865,18 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': SECTION . FD - STUDENTRECORDS + StudentRecords . 01 - STUDENTRECORD + StudentRecord . 88 - ENDOFSTUDENTFILE + EndOfStudentFile VALUE HIGH-VALUES . 02 - STUDENTID + StudentID PIC X(7) . @@ -4886,18 +4886,18 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': X(23) . FD - TRANSRECORDS + TransRecords . 01 - TRANSRECORD + TransRecord . 88 - ENDOFTRANSFILE + EndOfTransFile VALUE HIGH-VALUES . 02 - TRANSSTUDENTID + TransStudentID PIC X(7) . @@ -4907,10 +4907,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': X(23) . FD - NEWSTUDENTRECORDS + NewStudentRecords . 01 - NEWSTUDENTRECORD + NewStudentRecord PIC X(30) . @@ -4921,97 +4921,97 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqIns/seqinsert.CBL': . OPEN INPUT - STUDENTRECORDS + StudentRecords OPEN INPUT - TRANSRECORDS + TransRecords OPEN OUTPUT - NEWSTUDENTRECORDS + NewStudentRecords READ - STUDENTRECORDS + StudentRecords AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ READ - TRANSRECORDS + TransRecords AT END SET - ENDOFTRANSFILE + EndOfTransFile TO TRUE END-READ PERFORM UNTIL - (ENDOFSTUDENTFILE) + (EndOfStudentFile) AND - (ENDOFTRANSFILE) + (EndOfTransFile) EVALUATE TRUE WHEN - (STUDENTID + (StudentID < - TRANSSTUDENTID) + TransStudentID) WRITE - NEWSTUDENTRECORD + NewStudentRecord FROM - STUDENTRECORD + StudentRecord READ - STUDENTRECORDS + StudentRecords AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ WHEN - (STUDENTID + (StudentID > - TRANSSTUDENTID) + TransStudentID) WRITE - NEWSTUDENTRECORD + NewStudentRecord FROM - TRANSRECORD + TransRecord READ - TRANSRECORDS + TransRecords AT END SET - ENDOFTRANSFILE + EndOfTransFile TO TRUE END-READ WHEN - (STUDENTID + (StudentID = - TRANSSTUDENTID) + TransStudentID) DISPLAY "Error - " - TRANSSTUDENTID + TransStudentId " already exists in file" READ - TRANSRECORDS + TransRecords AT END SET - ENDOFTRANSFILE + EndOfTransFile TO TRUE END-READ END-EVALUATE END-PERFORM CLOSE - STUDENTRECORDS + StudentRecords CLOSE - TRANSRECORDS + TransRecords CLOSE - NEWSTUDENTRECORDS + NewStudentRecords STOP RUN . @@ -5023,12 +5023,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/Seqread.cbl': . PROGRAM-ID . - SEQREAD + SeqRead . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5039,7 +5039,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/Seqread.cbl': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -5055,102 +5055,102 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/Seqread.cbl': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTDETAILS + StudentDetails . 88 - ENDOFSTUDENTFILE + EndOfStudentFile VALUE HIGH-VALUES . 02 - STUDENTID + StudentId PIC 9(7) . 02 - STUDENTNAME + StudentName . 03 - SURNAME + Surname PIC X(8) . 03 - INITIALS + Initials PIC XX . 02 - DATEOFBIRTH + DateOfBirth . 03 - YOBIRTH + YOBirth PIC 9(4) . 03 - MOBIRTH + MOBirth PIC 9(2) . 03 - DOBIRTH + DOBirth PIC 9(2) . 02 - COURSECODE + CourseCode PIC X(4) . 02 - GENDER + Gender PIC X . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - STUDENTFILE + StudentFile READ - STUDENTFILE + StudentFile AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ PERFORM UNTIL - ENDOFSTUDENTFILE + EndOfStudentFile DISPLAY - STUDENTID + StudentId SPACE - STUDENTNAME + StudentName SPACE - COURSECODE + CourseCode SPACE - YOBIRTH + YOBirth READ - STUDENTFILE + StudentFile AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ END-PERFORM CLOSE - STUDENTFILE + StudentFile STOP RUN . @@ -5162,12 +5162,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/SeqreadNo88.cbl . PROGRAM-ID . - SEQREADNO88 + SeqReadNo88 . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5178,7 +5178,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/SeqreadNo88.cbl FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -5194,99 +5194,99 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRead/SeqreadNo88.cbl SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTDETAILS + StudentDetails . 02 - STUDENTID + StudentId PIC 9(7) . 02 - STUDENTNAME + StudentName . 03 - SURNAME + Surname PIC X(8) . 03 - INITIALS + Initials PIC XX . 02 - DATEOFBIRTH + DateOfBirth . 03 - YOBIRTH + YOBirth PIC 9(4) . 03 - MOBIRTH + MOBirth PIC 9(2) . 03 - DOBIRTH + DOBirth PIC 9(2) . 02 - COURSECODE + CourseCode PIC X(4) . 02 - GENDER + Gender PIC X . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - STUDENTFILE + StudentFile READ - STUDENTFILE + StudentFile AT END MOVE HIGH-VALUES TO - STUDENTDETAILS + StudentDetails END-READ PERFORM UNTIL - STUDENTDETAILS + StudentDetails = HIGH-VALUES DISPLAY - STUDENTID + StudentId SPACE - STUDENTNAME + StudentName SPACE - COURSECODE + CourseCode SPACE - YOBIRTH + YOBirth READ - STUDENTFILE + StudentFile AT END MOVE HIGH-VALUES TO - STUDENTDETAILS + StudentDetails END-READ END-PERFORM CLOSE - STUDENTFILE + StudentFile STOP RUN . @@ -5298,12 +5298,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': . PROGRAM-ID . - STUDENTNUMBERSREPORT + StudentNumbersReport . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5314,7 +5314,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -5324,7 +5324,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': SEQUENTIAL . SELECT - REPORTFILE + ReportFile ASSIGN TO "STUDENTS.RPT" @@ -5340,73 +5340,73 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTDETAILS + StudentDetails . 88 - ENDOFSTUDENTFILE + EndOfStudentFile VALUE HIGH-VALUES . 02 - STUDENTID + StudentId PIC 9(7) . 02 - STUDENTNAME + StudentName . 03 - SURNAME + Surname PIC X(8) . 03 - INITIALS + Initials PIC XX . 02 - DATEOFBIRTH + DateOfBirth . 03 - YOBIRTH + YOBirth PIC 9(4) . 03 - MOBIRTH + MOBirth PIC 9(2) . 03 - DOBIRTH + DOBirth PIC 9(2) . 02 - COURSECODE + CourseCode PIC X(4) . 02 - GENDER + Gender PIC X . 88 - MALE + Male VALUE "M" "m" . FD - REPORTFILE + ReportFile . 01 - PRINTLINE + PrintLine PIC X(40) . @@ -5414,14 +5414,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': SECTION . 01 - HEADINGLINE + HeadingLine PIC X(21) VALUE " Record Count Report" . 01 - STUDENTTOTALLINE + StudentTotalLine . 02 FILLER @@ -5431,12 +5431,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': "Total Students = " . 02 - PRNSTUDENTCOUNT + PrnStudentCount PIC Z,ZZ9 . 01 - MALETOTALLINE + MaleTotalLine . 02 FILLER @@ -5446,12 +5446,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': "Total Males = " . 02 - PRNMALECOUNT + PrnMaleCount PIC Z,ZZ9 . 01 - FEMALETOTALLINE + FemaleTotalLine . 02 FILLER @@ -5461,29 +5461,29 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': "Total Females = " . 02 - PRNFEMALECOUNT + PrnFemaleCount PIC Z,ZZ9 . 01 - WORKTOTALS + WorkTotals . 02 - STUDENTCOUNT + StudentCount PIC 9(4) VALUE ZERO . 02 - MALECOUNT + MaleCount PIC 9(4) VALUE ZERO . 02 - FEMALECOUNT + FemaleCount PIC 9(4) VALUE @@ -5492,101 +5492,101 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqRpt/SeqRpt.CBL': PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - STUDENTFILE + StudentFile OPEN OUTPUT - REPORTFILE + ReportFile READ - STUDENTFILE + StudentFile AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ PERFORM UNTIL - ENDOFSTUDENTFILE + EndOfStudentFile ADD 1 TO - STUDENTCOUNT + StudentCount IF - MALE + Male ADD 1 TO - MALECOUNT + MaleCount ELSE ADD 1 TO - FEMALECOUNT + FemaleCount END-IF READ - STUDENTFILE + StudentFile AT END SET - ENDOFSTUDENTFILE + EndOfStudentFile TO TRUE END-READ END-PERFORM PERFORM - PRINTREPORTLINES + PrintReportLines CLOSE - STUDENTFILE - REPORTFILE + StudentFile + ReportFile STOP RUN . - PRINTREPORTLINES + PrintReportLines . MOVE - STUDENTCOUNT + StudentCount TO - PRNSTUDENTCOUNT + PrnStudentCount MOVE - MALECOUNT + MaleCount TO - PRNMALECOUNT + PrnMaleCount MOVE - FEMALECOUNT + FemaleCount TO - PRNFEMALECOUNT + PrnFemaleCount WRITE - PRINTLINE + PrintLine FROM - HEADINGLINE + HeadingLine AFTER ADVANCING PAGE WRITE - PRINTLINE + PrintLine FROM - STUDENTTOTALLINE + StudentTotalLine AFTER ADVANCING 2 LINES WRITE - PRINTLINE + PrintLine FROM - MALETOTALLINE + MaleTotalLine AFTER ADVANCING 2 LINES WRITE - PRINTLINE + PrintLine FROM - FEMALETOTALLINE + FemaleTotalLine AFTER ADVANCING 2 @@ -5600,12 +5600,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqWrite/SEQWRITE.CBL': . PROGRAM-ID . - SEQWRITE + SeqWrite . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5616,7 +5616,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqWrite/SEQWRITE.CBL': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -5632,92 +5632,92 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SeqWrite/SEQWRITE.CBL': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTDETAILS + StudentDetails . 02 - STUDENTID + StudentId PIC 9(7) . 02 - STUDENTNAME + StudentName . 03 - SURNAME + Surname PIC X(8) . 03 - INITIALS + Initials PIC XX . 02 - DATEOFBIRTH + DateOfBirth . 03 - YOBIRTH + YOBirth PIC 9(4) . 03 - MOBIRTH + MOBirth PIC 9(2) . 03 - DOBIRTH + DOBirth PIC 9(2) . 02 - COURSECODE + CourseCode PIC X(4) . 02 - GENDER + Gender PIC X . PROCEDURE DIVISION . - BEGIN + Begin . OPEN OUTPUT - STUDENTFILE + StudentFile DISPLAY "Enter student details using template below. Enter no data to end." PERFORM - GETSTUDENTDETAILS + GetStudentDetails PERFORM UNTIL - STUDENTDETAILS + StudentDetails = SPACES WRITE - STUDENTDETAILS + StudentDetails PERFORM - GETSTUDENTDETAILS + GetStudentDetails END-PERFORM CLOSE - STUDENTFILE + StudentFile STOP RUN . - GETSTUDENTDETAILS + GetStudentDetails . DISPLAY "Enter - StudId, Surname, Initials, YOB, MOB, DOB, Course, Gender" DISPLAY "NNNNNNNSSSSSSSSIIYYYYMMDDCCCCG" ACCEPT - STUDENTDETAILS + StudentDetails . Done. @@ -5727,12 +5727,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': . PROGRAM-ID . - INPUTSORT + InputSort . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5743,7 +5743,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "SORTSTUD.DAT" @@ -5753,7 +5753,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': SEQUENTIAL . SELECT - WORKFILE + WorkFile ASSIGN TO "WORK.TMP" @@ -5765,21 +5765,21 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTDETAILS + StudentDetails PIC X(30) . SD - WORKFILE + WorkFile . 01 - WORKREC + WorkRec . 02 - WSTUDENTID + WStudentId PIC 9(7) . @@ -5791,25 +5791,25 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': PROCEDURE DIVISION . - BEGIN + Begin . SORT - WORKFILE + WorkFile ON ASCENDING KEY - WSTUDENTID + WStudentId INPUT PROCEDURE IS - GETSTUDENTDETAILS + GetStudentDetails GIVING - STUDENTFILE + StudentFile . STOP RUN . - GETSTUDENTDETAILS + GetStudentDetails . DISPLAY "Enter student details using template below." @@ -5821,17 +5821,17 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/InputSORT.CBL': DISPLAY "NNNNNNNSSSSSSSSIIYYYYMMDDCCCCG" ACCEPT - WORKREC + WorkRec . PERFORM UNTIL - WORKREC + WorkRec = SPACES RELEASE - WORKREC + WorkRec ACCEPT - WORKREC + WorkRec END-PERFORM . @@ -5842,12 +5842,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': . PROGRAM-ID . - MALESORT + MaleSort . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -5858,7 +5858,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': FILE-CONTROL . SELECT - STUDENTFILE + StudentFile ASSIGN TO "STUDENTS.DAT" @@ -5868,7 +5868,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': SEQUENTIAL . SELECT - MALESTUDENTFILE + MaleStudentFile ASSIGN TO "MALESTUDS.DAT" @@ -5878,7 +5878,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': SEQUENTIAL . SELECT - WORKFILE + WorkFile ASSIGN TO "WORK.TMP" @@ -5890,31 +5890,31 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': SECTION . FD - STUDENTFILE + StudentFile . 01 - STUDENTREC + StudentRec PIC X(30) . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . FD - MALESTUDENTFILE + MaleStudentFile . 01 - MALESTUDENTREC + MaleStudentRec PIC X(30) . SD - WORKFILE + WorkFile . 01 - WORKREC + WorkRec . 02 FILLER @@ -5922,7 +5922,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': 9(7) . 02 - WSTUDENTNAME + WStudentName PIC X(10) . @@ -5932,74 +5932,74 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Sort/MaleSORT.cbl': X(12) . 02 - WGENDER + WGender PIC X . 88 - MALESTUDENT + MaleStudent VALUE "M" . PROCEDURE DIVISION . - BEGIN + Begin . SORT - WORKFILE + WorkFile ON ASCENDING KEY - WSTUDENTNAME + WStudentName INPUT PROCEDURE IS - GETMALESTUDENTS + GetMaleStudents GIVING - MALESTUDENTFILE + MaleStudentFile . STOP RUN . - GETMALESTUDENTS + GetMaleStudents . OPEN INPUT - STUDENTFILE + StudentFile READ - STUDENTFILE + StudentFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ PERFORM UNTIL - ENDOFFILE + EndOfFile MOVE - STUDENTREC + StudentRec TO - WORKREC + WorkRec IF - MALESTUDENT + MaleStudent RELEASE - WORKREC + WorkRec END-IF READ - STUDENTFILE + StudentFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM CLOSE - STUDENTFILE + StudentFile . Done. @@ -6009,12 +6009,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/RefMod.cbl': . PROGRAM-ID . - REFMODIFICATION + RefModification . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -6023,56 +6023,56 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/RefMod.cbl': SECTION . 01 - XSTR + xStr PIC X(50) VALUE " This is the first source string" . 01 - XSTR2 + xStr2 PIC X(32) VALUE "This is the second source string" . 01 - STRSIZE + StrSize PIC 99 VALUE 32 . 01 - CHARCOUNT + CharCount PIC 99 VALUE ZEROS . 01 - ENDCOUNT + EndCount PIC 99 VALUE ZEROS . 01 - YSTR + yStr PIC X(4) VALUE SPACES . 01 - CHARPOS + CharPos PIC 99 VALUE ZEROS . 01 - STRLENGTH + StrLength PIC 99 VALUE @@ -6081,93 +6081,93 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/RefMod.cbl': PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Task1 = " - XSTR(9:3) + xStr(9:3) DISPLAY "Task2 = " - XSTR(1:7) + xStr(1:7) MOVE 13 TO - STRLENGTH + StrLength DISPLAY "Task3 = " - XSTR2((STRSIZE + xStr2((StrSize - - STRLENGTH) + StrLength) + - 1:STRLENGTH) + 1:StrLength) DISPLAY "Task4 Before = " - XSTR + xStr "<<<<<<" MOVE 0 TO - CHARCOUNT + CharCount INSPECT FUNCTION - REVERSE(XSTR) + REVERSE(xStr) TALLYING - CHARCOUNT + CharCount FOR LEADING SPACES DISPLAY "Task4 After = " - XSTR(1:50 + xStr(1:50 - - CHARCOUNT) + CharCount) "<<<<<<<" . PERFORM VARYING - CHARCOUNT + CharCount FROM 50 BY -1 UNTIL - XSTR(CHARCOUNT:1) + xStr(CharCount:1) NOT = SPACE END-PERFORM DISPLAY "Task4 After = " - XSTR(1:CHARCOUNT) + xStr(1:CharCount) "<<<<<<<" . MOVE 1 TO - CHARCOUNT + CharCount . INSPECT - XSTR + xStr TALLYING - CHARCOUNT + CharCount FOR LEADING SPACES DISPLAY "Task5 =" - XSTR(CHARCOUNT: + xStr(CharCount: 50 - - CHARCOUNT) + CharCount) MOVE 1 TO - CHARCOUNT + CharCount INSPECT - XSTR + xStr TALLYING - CHARCOUNT - FOR + CharCount + for CHARACTERS BEFORE INITIAL @@ -6175,55 +6175,55 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/RefMod.cbl': . DISPLAY "Task6 First occurrence is in char position " - CHARCOUNT + CharCount MOVE "fred" TO - YSTR + yStr MOVE 51 TO - ENDCOUNT + EndCount PERFORM VARYING - CHARPOS + CharPos FROM 1 BY 1 UNTIL - CHARPOS + CharPos > 4 MOVE 1 TO - CHARCOUNT + CharCount INSPECT - XSTR + xStr TALLYING - CHARCOUNT + CharCount FOR CHARACTERS BEFORE INITIAL - YSTR(CHARPOS:1) + yStr(CharPos:1) IF - CHARCOUNT + CharCount < - ENDCOUNT + EndCount MOVE - CHARCOUNT + CharCount TO - ENDCOUNT + EndCount END-IF END-PERFORM DISPLAY "Task7 First occurrence is in char position " - ENDCOUNT + EndCount DISPLAY "The character is " - XSTR(ENDCOUNT:1) + xStr(EndCount:1) STOP RUN . @@ -6235,12 +6235,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/UnstringFileEg. . PROGRAM-ID . - UNSTRINGFILEEG + UnstringFileEg . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -6251,7 +6251,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/UnstringFileEg. FILE-CONTROL . SELECT - VARLENGTHRECFILE + VarLengthRecFile ASSIGN TO "VarLen.DAT" @@ -6267,43 +6267,43 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/UnstringFileEg. SECTION . FD - VARLENGTHRECFILE + VarLengthRecFile . 01 - VARLENREC + VarLenRec . 88 - ENDOFFILE + EndOfFile VALUE HIGH-VALUES . 02 - TYPECODE + TypeCode PIC XX . 88 - DELETESUPPLIER + DeleteSupplier VALUE "1," . 88 - DELETEVIDEO + DeleteVideo VALUE "2," . 88 - INSERTVIDEO + InsertVideo VALUE "3," . 88 - INSERTSUPPLIER + InsertSupplier VALUE "4," . 88 - VALIDTYPECODE + ValidTypeCode VALUE "1," "2," @@ -6311,7 +6311,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/UnstringFileEg. "4," . 02 - REMAININGREC + RemainingRec PIC X(78) . @@ -6319,207 +6319,207 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/Strings/UnstringFileEg. SECTION . 01 - INSERTSUPPLIERREC + InsertSupplierRec . 02 - TRANSTYPE + TransType PIC 9 . 02 - TRANSDATE + TransDate PIC X(8) . 02 - SUPPLIER-CODE + Supplier-Code PIC XX . 02 - SUPPLIER-NAME + Supplier-Name PIC X(20) . 02 - SUPPLIER-ADDRESS + Supplier-Address PIC X(50) . 01 - INSERTSUPPLIERCOUNTS + InsertSupplierCounts . 02 - DATECOUNT + DateCount PIC 99 . 88 - VALIDDATE + ValidDate VALUE 8 . 02 - SUPPCODECOUNT + SuppCodeCount PIC 99 . 88 - VALIDSUPPCODE + ValidSuppCode VALUE 1 THRU 2 . 02 - SUPPNAMECOUNT + SuppNameCount PIC 99 . 88 - VALIDSUPPNAME + ValidSuppName VALUE 1 THRU 20 . 02 - SUPPADRCOUNT + SuppAdrCount PIC 99 . 88 - VALIDSUPPADR + ValidSuppAdr VALUE 1 THRU 50 . 01 - STRINGEND + StringEnd PIC 99 . PROCEDURE DIVISION . - BEGIN + Begin . OPEN INPUT - VARLENGTHRECFILE + VarLengthRecFile READ - VARLENGTHRECFILE + VarLengthRecFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ PERFORM UNTIL - ENDOFFILE + EndOfFile MOVE ZEROS TO - INSERTSUPPLIERCOUNTS + InsertSupplierCounts PERFORM VARYING - STRINGEND + StringEnd FROM 78 BY -1 UNTIL - REMAININGREC(STRINGEND:1) + RemainingRec(StringEnd:1) NOT = SPACE END-PERFORM IF - INSERTSUPPLIER + InsertSupplier UNSTRING - REMAININGREC(1:STRINGEND) + RemainingRec(1:StringEnd) DELIMITED BY "," INTO - TRANSDATE + TransDate COUNT IN - DATECOUNT - SUPPLIER-CODE + DateCount + Supplier-Code COUNT IN - SUPPCODECOUNT - SUPPLIER-NAME + SuppCodeCount + Supplier-Name COUNT IN - SUPPNAMECOUNT - SUPPLIER-ADDRESS + SuppNameCount + Supplier-Address COUNT IN - SUPPADRCOUNT + SuppAdrCount END-UNSTRING PERFORM - CHECKFORERRORS + CheckForErrors ELSE IF NOT - VALIDTYPECODE + ValidTypeCode DISPLAY SPACE DISPLAY "Record = " - VARLENREC(1:70) + VarLenRec(1:70) DISPLAY "Type code is not valid" END-IF END-IF READ - VARLENGTHRECFILE + VarLengthRecFile AT END SET - ENDOFFILE + EndOfFile TO TRUE END-READ END-PERFORM CLOSE - VARLENGTHRECFILE + VarLengthRecFile STOP RUN . - CHECKFORERRORS + CheckForErrors . DISPLAY SPACE DISPLAY "Record = " - VARLENREC(1:70) + VarLenRec(1:70) IF NOT - VALIDDATE + ValidDate DISPLAY "Date Size Error" END-IF IF NOT - VALIDSUPPCODE + ValidSuppCode DISPLAY "Supplier Code Error" END-IF IF NOT - VALIDSUPPNAME + ValidSuppName DISPLAY "Supplier name Error" END-IF IF NOT - VALIDSUPPADR + ValidSuppAdr DISPLAY "Supplier address Error" END-IF @@ -6532,12 +6532,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/DateD . PROGRAM-ID . - DATEDRIVER + DateDriver . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -6553,59 +6553,59 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/DateD 0 . 88 - ENDOFINPUT + EndOfInput VALUE 1 . 01 - INPUTDATEIN + InputDateIn PIC 9(8) . 01 - VALIDATIONRESULT + ValidationResult PIC 9 . 88 - DATEISVALID + DateIsValid VALUE 0 . 88 - DATENOTNUMERIC + DateNotNumeric VALUE 1 . 88 - YEARCONTAINSZEROS + YearContainsZeros VALUE 2 . 88 - MONTHCONTAINSZEROS + MonthContainsZeros VALUE 3 . 88 - DAYCONTAINSZEROS + DayContainsZeros VALUE 4 . 88 - MONTHGREATERTHAN12 + MonthGreaterThan12 VALUE 5 . 88 - DAYTOOGREATFORMONTH + DayTooGreatForMonth VALUE 6 . PROCEDURE DIVISION . - BEGIN + Begin . DISPLAY "Input Date as DDMMYYYY > " @@ -6613,47 +6613,47 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/DateD NO ADVANCING ACCEPT - INPUTDATEIN + InputDateIn CALL "Validate" USING - INPUTDATEIN - VALIDATIONRESULT + InputDateIn + ValidationResult . DISPLAY "RESULT = " - VALIDATIONRESULT + ValidationResult DISPLAY "DATE IS NOW = " - INPUTDATEIN + InputDateIn EVALUATE TRUE WHEN - DATEISVALID + DateIsValid DISPLAY "Date is valid." WHEN - DATENOTNUMERIC + DateNotNumeric DISPLAY "Date is not numeric." WHEN - YEARCONTAINSZEROS + YearContainsZeros DISPLAY "Year contains all zeros." WHEN - MONTHCONTAINSZEROS + MonthContainsZeros DISPLAY "Month contains all zeros." WHEN - DAYCONTAINSZEROS + DayContainsZeros DISPLAY "Day contains all zeros." WHEN - MONTHGREATERTHAN12 + MonthGreaterThan12 DISPLAY "Month too great." WHEN - DAYTOOGREATFORMONTH + DayTooGreatForMonth DISPLAY "Day too great for month." END-EVALUATE @@ -6669,14 +6669,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD . PROGRAM-ID . - VALIDATE + Validate IS INITIAL . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . DATA DIVISION @@ -6685,10 +6685,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD SECTION . 01 - MONTHDAYTABLE + MonthDayTable . 02 - TABLEVALUES + TableValues PIC X(24) VALUE @@ -6697,10 +6697,10 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD 02 FILLER REDEFINES - TABLEVALUES + TableValues . 03 - DAYSINMONTH + DaysInMonth OCCURS 12 TIMES @@ -6708,17 +6708,17 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD 99 . 01 - CURRUPTDATE + CurruptDate PIC 9(8) . 01 - LEAPQUOT + LeapQuot PIC 9(4) . 01 - LEAPREMAIN + LeapRemain PIC 9(4) . @@ -6730,7 +6730,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD ZERO . 88 - LEAPYEAR + LeapYear VALUE 1 . @@ -6738,207 +6738,207 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DateValid/ValiD SECTION . 01 - INPUTDATELA + InputDateLA . 02 - DAYLA + DayLA PIC 99 . 02 - MONTHLA + MonthLA PIC 99 . 88 - MONTHINVALID + MonthInvalid VALUE 13 THRU 99 . 88 - MONTHISFEBRUARY + MonthIsFebruary VALUE 2 . 02 - YEARLA + YearLA PIC 9(4) . 01 - VALIDATIONRESULTLB + ValidationResultLB PIC 9 . 88 - DATEISVALID + DateIsValid VALUE 0 . 88 - DATENOTNUMERIC + DateNotNumeric VALUE 1 . 88 - YEARCONTAINSZEROS + YearContainsZeros VALUE 2 . 88 - MONTHCONTAINSZEROS + MonthContainsZeros VALUE 3 . 88 - DAYCONTAINSZEROS + DayContainsZeros VALUE 4 . 88 - MONTHGREATERTHAN12 + MonthGreaterThan12 VALUE 5 . 88 - DAYTOOGREATFORMONTH + DayTooGreatForMonth VALUE 6 . PROCEDURE DIVISION USING - INPUTDATELA - VALIDATIONRESULTLB + InputDateLA + ValidationResultLB . - BEGIN + Begin . EVALUATE TRUE WHEN - INPUTDATELA + InputDateLA NOT NUMERIC SET - DATENOTNUMERIC + DateNotNumeric TO TRUE WHEN - YEARLA + YearLA EQUAL TO ZEROS SET - YEARCONTAINSZEROS + YearContainsZeros TO TRUE WHEN - MONTHLA + MonthLA EQUAL TO ZEROS SET - MONTHCONTAINSZEROS + MonthContainsZeros TO TRUE WHEN - DAYLA + DayLA EQUAL TO ZEROS SET - DAYCONTAINSZEROS + DayContainsZeros TO TRUE WHEN - MONTHINVALID + MonthInvalid SET - MONTHGREATERTHAN12 + MonthGreaterThan12 TO TRUE WHEN OTHER PERFORM - CHECKFORVALIDDAY + CheckForValidDay END-EVALUATE EXIT PROGRAM . - CHECKFORVALIDDAY + CheckForValidDay . DIVIDE - YEARLA + YearLA BY 400 GIVING - LEAPQUOT + LeapQuot REMAINDER - LEAPREMAIN + LeapRemain . IF - LEAPREMAIN + LeapRemain = 0 SET - LEAPYEAR + LeapYear TO TRUE ELSE DIVIDE - YEARLA + YearLA BY 100 GIVING - LEAPQUOT + LeapQuot REMAINDER - LEAPREMAIN + LeapRemain IF - LEAPREMAIN + LeapRemain NOT = 0 DIVIDE - YEARLA + YearLA BY 4 GIVING - LEAPQUOT + LeapQuot REMAINDER - LEAPREMAIN + LeapRemain IF - LEAPREMAIN + LeapRemain = 0 SET - LEAPYEAR + LeapYear TO TRUE END-IF END-IF END-IF IF - LEAPYEAR + LeapYear AND - MONTHISFEBRUARY + MonthIsFebruary MOVE 29 TO - DAYSINMONTH(2) + DaysInMonth(2) END-IF IF - DAYLA + DayLA GREATER THAN - DAYSINMONTH(MONTHLA) + DaysInMonth(MonthLA) SET - DAYTOOGREATFORMONTH + DayTooGreatForMonth TO TRUE ELSE SET - DATEISVALID + DateIsValid TO TRUE END-IF @@ -6951,12 +6951,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff . PROGRAM-ID . - DAYDIFFDRIVER + DayDiffDriver . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -6968,179 +6968,179 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - DATES + Dates . 02 - FIRSTDATE + FirstDate PIC X(8) . 02 - SECONDDATE + SecondDate PIC X(8) . 02 - FIRSTDATEPRN + FirstDatePrn PIC XX/XX/XXXX . 02 - SECONDDATEPRN + SecondDatePrn PIC XX/XX/XXXX . 01 - DAYDIFFS + DayDiffs . 02 - DAYDIFFERENCE + DayDifference PIC S9(7) . 02 - DAYDIFFERENCEPRN + DayDifferencePrn PIC ----,--9 . 01 - VALIDATIONRESULT + ValidationResult PIC 9 . 88 - DATEISVALID + DateIsValid VALUE 0 . 88 - DATEISNOTVALID + DateIsNotValid VALUE 1 THRU 6 . 88 - DATENOTNUMERIC + DateNotNumeric VALUE 1 . 88 - YEARCONTAINSZEROS + YearContainsZeros VALUE 2 . 88 - MONTHCONTAINSZEROS + MonthContainsZeros VALUE 3 . 88 - DAYCONTAINSZEROS + DayContainsZeros VALUE 4 . 88 - MONTHGREATERTHAN12 + MonthGreaterThan12 VALUE 5 . 88 - DAYTOOGREATFORMONTH + DayTooGreatForMonth VALUE 6 . PROCEDURE DIVISION . - BEGIN + Begin . SET - DATEISNOTVALID + DateIsNotValid TO TRUE . PERFORM - GETVALIDFIRSTDATE + GetValidFirstDate UNTIL - DATEISVALID + DateIsValid . SET - DATEISNOTVALID + DateIsNotValid TO TRUE . PERFORM - GETVALIDSECONDDATE + GetValidSecondDate UNTIL - DATEISVALID + DateIsValid . CALL "EuroDateToSortDate" USING - FIRSTDATE - FIRSTDATE + FirstDate + FirstDate . CALL "EuroDateToSortDate" USING - SECONDDATE - SECONDDATE + SecondDate + SecondDate . CALL "GetDayDiff" USING BY CONTENT - FIRSTDATE - SECONDDATE + FirstDate + SecondDate BY REFERENCE - DAYDIFFERENCE + DayDifference . CALL "SortDateToEuroDate" USING - FIRSTDATE - FIRSTDATE + FirstDate + FirstDate . CALL "SortDateToEuroDate" USING - SECONDDATE - SECONDDATE + SecondDate + SecondDate . MOVE - DAYDIFFERENCE + DayDifference TO - DAYDIFFERENCEPRN + DayDifferencePrn . MOVE - FIRSTDATE + FirstDate TO - FIRSTDATEPRN + FirstDatePrn . MOVE - SECONDDATE + SecondDate TO - SECONDDATEPRN + SecondDatePrn . DISPLAY SPACES . DISPLAY "The difference between " - FIRSTDATEPRN + FirstDatePrn " and " - SECONDDATEPRN + SecondDatePrn " is " - DAYDIFFERENCEPRN + DayDifferencePrn " days." . STOP RUN . - GETVALIDFIRSTDATE + GetValidFirstDate . DISPLAY SPACES @@ -7151,25 +7151,25 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff ADVANCING . ACCEPT - FIRSTDATE + FirstDate . CALL "Validate" USING BY CONTENT - FIRSTDATE + FirstDate BY REFERENCE - VALIDATIONRESULT + ValidationResult . IF - DATEISNOTVALID + DateIsNotValid PERFORM - DISPLAYERRORMESSAGE + DisplayErrorMessage END-IF . - GETVALIDSECONDDATE + GetValidSecondDate . DISPLAY SPACES @@ -7180,53 +7180,53 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff ADVANCING . ACCEPT - SECONDDATE + SecondDate . CALL "Validate" USING BY CONTENT - SECONDDATE + SecondDate BY REFERENCE - VALIDATIONRESULT + ValidationResult . IF - DATEISNOTVALID + DateIsNotValid PERFORM - DISPLAYERRORMESSAGE + DisplayErrorMessage END-IF . - DISPLAYERRORMESSAGE + DisplayErrorMessage . DISPLAY "Invalid date . Return code = " - VALIDATIONRESULT + ValidationResult EVALUATE TRUE WHEN - DATENOTNUMERIC + DateNotNumeric DISPLAY "Date is not numeric." WHEN - YEARCONTAINSZEROS + YearContainsZeros DISPLAY "Year contains all zeros." WHEN - MONTHCONTAINSZEROS + MonthContainsZeros DISPLAY "Month contains all zeros." WHEN - DAYCONTAINSZEROS + DayContainsZeros DISPLAY "Day contains all zeros." WHEN - MONTHGREATERTHAN12 + MonthGreaterThan12 DISPLAY "Month to great." WHEN - DAYTOOGREATFORMONTH + DayTooGreatForMonth DISPLAY "Day to great for month." END-EVALUATE @@ -7236,12 +7236,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff . PROGRAM-ID . - EURODATETOSORTDATE + EuroDateToSortDate . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7253,20 +7253,20 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - YYYYDDMMTEMP + YYYYDDMMTemp . 02 - YYYYYEAR + YYYYYear PIC XXXX . 02 - YYYYMONTH + YYYYMonth PIC XX . 02 - YYYYDAY + YYYYDay PIC XX . @@ -7274,74 +7274,74 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - DDMMYYYYDATE + DDMMYYYYDate . 02 - DDMMDAY + DDMMDay PIC XX . 02 - DDMMMONTH + DDMMMonth PIC XX . 02 - DDMMYEAR + DDMMYear PIC XXXX . 01 - YYYYDDMMDATE + YYYYDDMMDate PIC X(8) . PROCEDURE DIVISION USING - DDMMYYYYDATE - YYYYDDMMDATE + DDMMYYYYDate + YYYYDDMMDate . - BEGIN + Begin . MOVE - DDMMDAY + DDMMDay TO - YYYYDAY + YYYYDay . MOVE - DDMMMONTH + DDMMMonth TO - YYYYMONTH + YYYYMonth . MOVE - DDMMYEAR + DDMMYear TO - YYYYYEAR + YYYYYear . MOVE YYYYDDMMTEMP TO - YYYYDDMMDATE + YYYYDDMMDate . EXIT PROGRAM . END PROGRAM - EURODATETOSORTDATE + EuroDateToSortDate . IDENTIFICATION DIVISION . PROGRAM-ID . - SORTDATETOEURODATE + SortDateToEuroDate . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7353,20 +7353,20 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - DDMMYYYYTEMP + DDMMYYYYTemp . 02 - DDMMDAY + DDMMDay PIC XX . 02 - DDMMMONTH + DDMMMonth PIC XX . 02 - DDMMYEAR + DDMMYear PIC XXXX . @@ -7374,74 +7374,74 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - YYYYDDMMDATE + YYYYDDMMDate . 02 - YYYYYEAR + YYYYYear PIC XXXX . 02 - YYYYMONTH + YYYYMonth PIC XX . 02 - YYYYDAY + YYYYDay PIC XX . 01 - DDMMYYYYDATE + DDMMYYYYDate PIC X(8) . PROCEDURE DIVISION USING - YYYYDDMMDATE - DDMMYYYYDATE + YYYYDDMMDate + DDMMYYYYDate . - BEGIN + Begin . MOVE - YYYYDAY + YYYYDay TO - DDMMDAY + DDMMDay . MOVE - YYYYMONTH + YYYYMonth TO - DDMMMONTH + DDMMMonth . MOVE - YYYYYEAR + YYYYYear TO - DDMMYEAR + DDMMYear . MOVE DDMMYYYYTEMP TO - DDMMYYYYDATE + DDMMYYYYDate . EXIT PROGRAM . END PROGRAM - SORTDATETOEURODATE + SortDateToEuroDate . IDENTIFICATION DIVISION . PROGRAM-ID . - GETDAYDIFF + GetDayDiff . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7453,46 +7453,46 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/DayDiff/DayDiff SECTION . 01 - DATE1 + Date1 PIC 9(8) . 01 - DATE2 + Date2 PIC 9(8) . 01 - DIFFERENCE + Difference PIC S9(7) . PROCEDURE DIVISION USING - DATE1 - DATE2 - DIFFERENCE + Date1 + Date2 + Difference . - BEGIN + Begin . COMPUTE - DIFFERENCE + Difference = FUNCTION - INTEGER-OF-DATE(DATE2)- + INTEGER-OF-DATE(Date2)- FUNCTION - INTEGER-OF-DATE(DATE1) + INTEGER-OF-DATE(Date1) EXIT PROGRAM . END PROGRAM - GETDAYDIFF + GetDayDiff . END PROGRAM - DAYDRIVER + DayDriver . Done. @@ -7502,12 +7502,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver . PROGRAM-ID . - DRIVERPROG + DriverProg . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7519,44 +7519,44 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver SECTION . 01 - USERNUMBER + UserNumber PIC 99 . 01 - PRNRESULT + PrnResult PIC 9(6) . 01 - PARAMETERS + Parameters . 02 - NUMBER1 + Number1 PIC 9(3) . 02 - NUMBER2 + Number2 PIC 9(3) . 02 - FIRSTSTRING + FirstString PIC X(19) VALUE "First parameter = " . 02 - SECONDSTRING + SecondString PIC X(19) VALUE "Second parameter = " . 02 - RESULT + Result PIC 9(6) COMP @@ -7564,22 +7564,22 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver PROCEDURE DIVISION . - BEGIN + Begin . PERFORM - CALLMULTIPLYNUMS + CallMultiplyNums . PERFORM - CALLFICKLE + CallFickle PERFORM - CALLSTEADFAST + CallSteadfast PERFORM - MAKEFICKLESTEADFAST + MakeFickleSteadfast . STOP RUN . - CALLMULTIPLYNUMS + CallMultiplyNums . DISPLAY "Input 2 numbers (3 digits each) to be multiplied" @@ -7589,22 +7589,22 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver NO ADVANCING ACCEPT - NUMBER1 + Number1 DISPLAY "Second number - " WITH NO ADVANCING ACCEPT - NUMBER2 + Number2 . DISPLAY "The first string is " - FIRSTSTRING + FirstString . DISPLAY "The second string is " - SECONDSTRING + SecondString . DISPLAY ">>>>>>>>> Calling the sub-program now" @@ -7614,38 +7614,38 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver USING BY CONTENT - NUMBER1 - NUMBER2 - FIRSTSTRING + Number1 + Number2 + FirstString BY REFERENCE - SECONDSTRING - RESULT + SecondString + Result . DISPLAY "Back in the main program now <<<<<<<<<<<" . MOVE - RESULT - TO - PRNRESULT + Result + to + PrnResult . DISPLAY - NUMBER1 + Number1 " multiplied by " - NUMBER2 + Number2 " is = " - PRNRESULT + PrnResult . DISPLAY "The first string is " - FIRSTSTRING + FirstString . DISPLAY "The second string is " - SECONDSTRING + SecondString . - CALLFICKLE + CallFickle . DISPLAY SPACE @@ -7654,35 +7654,35 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber . - CALLSTEADFAST + CallSteadFast . DISPLAY SPACE @@ -7691,35 +7691,35 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver MOVE 10 TO - USERNUMBER + UserNumber CALL "Steadfast" USING BY CONTENT - USERNUMBER + UserNumber MOVE 10 TO - USERNUMBER + UserNumber CALL "Steadfast" USING BY CONTENT - USERNUMBER + UserNumber MOVE 10 TO - USERNUMBER + UserNumber CALL "Steadfast" USING BY CONTENT - USERNUMBER + UserNumber . - MAKEFICKLESTEADFAST + MakeFickleSteadfast . DISPLAY SPACE @@ -7730,37 +7730,37 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Driver MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber CANCEL "Fickle" MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber CANCEL "Fickle" MOVE 10 TO - USERNUMBER + UserNumber CALL "Fickle" USING BY CONTENT - USERNUMBER + UserNumber . Done. @@ -7770,12 +7770,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Fickle . PROGRAM-ID . - FICKLE + Fickle . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7787,7 +7787,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Fickle SECTION . 01 - RUNNINGTOTAL + RunningTotal PIC 9(4) VALUE @@ -7797,25 +7797,25 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Fickle SECTION . 01 - PARAM1 + Param1 PIC 99 . PROCEDURE DIVISION USING - PARAM1 + Param1 . - BEGIN + Begin . ADD - PARAM1 + Param1 TO - RUNNINGTOTAL + RunningTotal . DISPLAY "The total so far is " - RUNNINGTOTAL + RunningTotal EXIT PROGRAM . @@ -7827,12 +7827,12 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Multip . PROGRAM-ID . - MULTIPLYNUMS + MultiplyNums . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7844,65 +7844,65 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Multip SECTION . 01 - PARAM1 + Param1 PIC 9(3) . 01 - PARAM2 + Param2 PIC 9(3) . 01 - ANSWER + Answer PIC 9(6) COMP . 01 - STRA + StrA PIC X(20) . 01 - STRB + StrB PIC X(20) . PROCEDURE DIVISION USING - PARAM1 - PARAM2 - STRA - STRB - ANSWER + Param1 + Param2 + StrA + StrB + Answer . - BEGIN + Begin . DISPLAY ">>>>>>>>>>>>>>>>> In the sub-program" DISPLAY - STRA - PARAM1 + StrA + Param1 DISPLAY - STRB - PARAM2 + StrB + Param2 MULTIPLY - PARAM1 + Param1 BY - PARAM2 + Param2 GIVING - ANSWER + Answer . MOVE "VALUE OVERWRITTEN" TO - STRA + StrA MOVE "VALUE OVERWRITTEN" TO - STRB + StrB DISPLAY "<<<<<<<<<<<<<< Leaving sub-program now" . @@ -7917,14 +7917,14 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Steadf . PROGRAM-ID . - STEADFAST + Steadfast IS INITIAL . AUTHOR . - MICHAEL - COUGHLAN + Michael + Coughlan . ENVIRONMENT DIVISION @@ -7936,7 +7936,7 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Steadf SECTION . 01 - RUNNINGTOTAL + RunningTotal PIC 9(4) VALUE @@ -7946,25 +7946,25 @@ Pre-processing `test/testsuite/microfocus/www.csis.ul.ie/SubProg/Multiply/Steadf SECTION . 01 - PARAM1 + Param1 PIC 99 . PROCEDURE DIVISION USING - PARAM1 + Param1 . - BEGIN + Begin . ADD - PARAM1 + Param1 TO - RUNNINGTOTAL + RunningTotal . DISPLAY "The total so far is " - RUNNINGTOTAL + RunningTotal EXIT PROGRAM . diff --git a/test/output-tests/run_file.expected b/test/output-tests/run_file.expected index 429339ac4..2903b3673 100644 --- a/test/output-tests/run_file.expected +++ b/test/output-tests/run_file.expected @@ -5258,7 +5258,7 @@ run_file.at-9434-prog.cob:17.11-17.24: ---- ^^^^^^^^^^^^^ 18 01 LSEQ-FILENAME PIC X(44) 19 VALUE 'FCDLS'. ->> Error: Library `XFHFCD3' not found in search path (search path: ) +>> Error: Library `xfhfcd3' not found in search path (search path: ) run_file.at-9434-prog.cob:46.16-46.22: 43 DISPLAY PROGRAM-NAME ': STARTING.' @@ -5341,7 +5341,7 @@ run_file.at-9643-prog.cob:19.11-19.24: ---- ^^^^^^^^^^^^^ 20 01 FIX-FILENAME PIC X(44) 21 VALUE 'FCDFB'. ->> Error: Library `XFHFCD3' not found in search path (search path: ) +>> Error: Library `xfhfcd3' not found in search path (search path: ) run_file.at-9643-prog.cob:48.16-48.22: 45 DISPLAY PROGRAM-NAME ': STARTING.' @@ -5473,7 +5473,7 @@ run_file.at-10153-prog.cob:86.11-86.23: ---- ^^^^^^^^^^^^ 87 88 01 FILE-NAME PIC X(64). ->> Error: Library `XFHFCD' not found in search path (search path: ) +>> Error: Library `xfhfcd' not found in search path (search path: ) run_file.at-10153-prog.cob:155.16-155.22: 152 SET FCD-FILENAME-ADDRESS TO ADDRESS OF FILE-NAME @@ -5505,7 +5505,7 @@ run_file.at-10488-prog.cob:97.11-97.23: ---- ^^^^^^^^^^^^ 98 99 01 RECORD-AREA. ->> Error: Library `XFHFCD' not found in search path (search path: ) +>> Error: Library `xfhfcd' not found in search path (search path: ) Considering: import/gnucobol/tests/testsuite.src/run_file.at:10488:0 run_file.at-10488-progs.cob:2.6-2.19: @@ -5525,7 +5525,7 @@ run_file.at-10676-prog.cob:86.12-86.24: ---- ^^^^^^^^^^^^ 87 88 01 RECORD-AREA. ->> Error: Library `XFHFCD' not found in search path (search path: ) +>> Error: Library `xfhfcd' not found in search path (search path: ) run_file.at-10676-prog.cob:134.16-134.22: 131 ** FIXED(0) OR VARIABLE(1) diff --git a/test/output-tests/run_misc.expected b/test/output-tests/run_misc.expected index e363fb5a7..10e98cf24 100644 --- a/test/output-tests/run_misc.expected +++ b/test/output-tests/run_misc.expected @@ -4466,7 +4466,7 @@ run_misc.at-10503-prog.cob:198.12-198.25: ---- ^^^^^^^^^^^^^ 199 IF ADDRESS OF TEST-BASED NOT = NULL 200 DISPLAY TEST-BASED-SUB ->> Error: Library `CPYABRT' not found in search path (search path: ) +>> Error: Library `cpyabrt' not found in search path (search path: ) Considering: import/gnucobol/tests/testsuite.src/run_misc.at:10923:0 run_misc.at-10923-reference_fdls_tmpl:4.6-4.7: @@ -4984,7 +4984,7 @@ run_misc.at-10503-sub2.cob:84.11-84.24: 84 > COPY cpyabrt. ---- ^^^^^^^^^^^^^ 85 END PROGRAM sub2. ->> Error: Library `CPYABRT' not found in search path (search path: ) +>> Error: Library `cpyabrt' not found in search path (search path: ) Considering: import/gnucobol/tests/testsuite.src/run_misc.at:11129:0 run_misc.at-11129-prog.cob:69.35: diff --git a/test/output-tests/syn_copy.expected b/test/output-tests/syn_copy.expected index 3e2ff1aad..420a7646e 100644 --- a/test/output-tests/syn_copy.expected +++ b/test/output-tests/syn_copy.expected @@ -29,7 +29,7 @@ syn_copy.at-114-prog3.cob:6.7-6.31: ---- ^^^^^^^^^^^^^^^^^^^^^^^^ 7 PROCEDURE DIVISION. 8 DISPLAY TEST-VAR. ->> Error: Library `copy.inc' not found in search path (search path: SUB2) +>> Error: Library `copy.inc' not found in search path (search path: sub2) Considering: import/gnucobol/tests/testsuite.src/syn_copy.at:115:0 syn_copy.at-115-prog4.cob:6.7-6.23: diff --git a/test/output-tests/syn_misc.expected b/test/output-tests/syn_misc.expected index 192212b1f..fa3ca7207 100644 --- a/test/output-tests/syn_misc.expected +++ b/test/output-tests/syn_misc.expected @@ -2409,7 +2409,7 @@ syn_misc.at-3227-prog.cob:10.7-10.15: ---- ^^^^^^^^ 11 12 78 var VALUE "hello". ->> Error: Library `A.' not found in search path (search path: ) +>> Error: Library `a.' not found in search path (search path: ) syn_misc.at-3227-prog.cob:7.30-7.31: 4 From 39e0cc247e9bdd0d9980f9a65ac66bce2893d939 Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Mon, 22 Jan 2024 11:47:19 +0100 Subject: [PATCH 2/2] Adapt comparison of (qualified) names to mixed-case internal representations --- src/lsp/cobol_lsp/lsp_lookup.ml | 6 -- src/lsp/cobol_ptree/terms.ml | 127 ++++++++++++++++---------------- src/lsp/cobol_unit/unit_qual.ml | 26 ++++--- test/lsp/lsp_definition.ml | 58 +++++++-------- 4 files changed, 109 insertions(+), 108 deletions(-) diff --git a/src/lsp/cobol_lsp/lsp_lookup.ml b/src/lsp/cobol_lsp/lsp_lookup.ml index b6ef96e5d..0792d9939 100644 --- a/src/lsp/cobol_lsp/lsp_lookup.ml +++ b/src/lsp/cobol_lsp/lsp_lookup.ml @@ -61,12 +61,6 @@ open TYPES (* --- *) -let bare name : Cobol_ptree.qualname = Cobol_ptree.Name name -let qual name : Cobol_ptree.qualname option -> Cobol_ptree.qualname = function - | None -> Cobol_ptree.Name name - | Some qn -> Cobol_ptree.Qual (name, qn) -let simple_name : Cobol_ptree.qualname -> string = function - | Qual (n, _) | Name n -> ~&n let baseloc_of_qualname: Cobol_ptree.qualname -> srcloc = function | Name name | Qual (name, _) -> ~@name diff --git a/src/lsp/cobol_ptree/terms.ml b/src/lsp/cobol_ptree/terms.ml index e6d7a1c72..a917559b7 100644 --- a/src/lsp/cobol_ptree/terms.ml +++ b/src/lsp/cobol_ptree/terms.ml @@ -14,7 +14,7 @@ open Common open Numericals -type name = string [@@deriving ord] +type name = string let pp_name = Pretty.string let pp_name' ppf { payload; _ } = pp_name ppf payload @@ -318,12 +318,14 @@ module COMPARE = struct if first <> 0 then first else Lazy.force lazy_cmp - let compare_with_loc_name = - compare_with_loc compare_name + + let compare_name a b = + String.compare (String.uppercase_ascii a) (String.uppercase_ascii b) let rec compare_term: type a. a term compare_fun = fun x y -> match x , y with - | Alphanum a, Alphanum b -> compare_alphanum_string a b + | Alphanum a, Alphanum b -> + compare_alphanum_string a b | Alphanum _, Fig HighValue -> -1 | Alphanum _, Fig _ -> 1 @@ -349,9 +351,9 @@ module COMPARE = struct | Fig _, Fig _ -> 0 (* TODO: `compare_fig` *) | Name a, Name b -> - compare_with_loc_name a b + compare_with_loc compare_name a b | Qual (a, c), Qual (b, d) -> - let first = compare_with_loc_name a b in + let first = compare_with_loc compare_name a b in if first <> 0 then first else compare_term c d @@ -382,7 +384,8 @@ module COMPARE = struct | Atom a ,Atom b -> compare_term a b | Unop(a, c), Unop(b, d) -> - compare_struct (Stdlib.compare a b) @@ lazy (compare_expression c d) + compare_struct (Stdlib.compare a b) @@ + lazy (compare_expression c d) | Binop(a, c ,e), Binop(b, d, f) -> compare_struct (Stdlib.compare c d) @@ lazy (compare_struct (compare_expression a b) @@ @@ -401,78 +404,76 @@ module COMPARE = struct and compare_binary_relation (x1, r1, y1) (x2, r2, y2) = compare_struct (compare_expression x1 x2) @@ - lazy (compare_struct (compare r1 r2) @@ lazy (compare_expression y1 y2)) + lazy (compare_struct (compare r1 r2) @@ + lazy (compare_expression y1 y2)) and compare_abbrev_combined_relation (b1, r1, x1, y1) (b2, r2, x2, y2) = - compare_struct (Bool.compare b1 b2) @@ lazy ( - compare_struct (compare_binary_relation r1 r2) @@ lazy ( - compare_struct (compare_logop x1 x2) @@ - lazy (compare_flat_combined_relation y1 y2) - ) - ) + compare_struct (Bool.compare b1 b2) @@ + lazy (compare_struct (compare_binary_relation r1 r2) @@ + lazy (compare_struct (compare_logop x1 x2) @@ + lazy (compare_flat_combined_relation y1 y2))) and compare_flat_combined_relation a b = match a, b with | FlatAmbiguous (ro1, e1), FlatAmbiguous (ro2, e2) -> - compare_struct (Option.compare compare_relop ro1 ro2) @@ - lazy (compare_expression e1 e2) + compare_struct (Option.compare compare_relop ro1 ro2) @@ + lazy (compare_expression e1 e2) | FlatAmbiguous _, _ -> -1 | _, FlatAmbiguous _ -> 1 | FlatNotExpr e1, FlatNotExpr e2 -> compare_expression e1 e2 | FlatNotExpr _, _ -> -1 | _, FlatNotExpr _ -> 1 | FlatRel (b1, r1), FlatRel (b2, r2) -> - compare_struct (Bool.compare b1 b2) @@ - lazy (compare_binary_relation r1 r2) + compare_struct (Bool.compare b1 b2) @@ + lazy (compare_binary_relation r1 r2) | FlatRel _, _ -> -1 | _, FlatRel _ -> 1 | FlatOther c1, FlatOther c2 -> compare_cond c1 c2 | FlatOther _, _ -> -1 | _, FlatOther _ -> 1 | FlatComb (x1, o1, y1), FlatComb (x2, o2, y2) -> - compare_struct (compare_flat_combined_relation x1 x2) @@ lazy ( - compare_struct (compare_logop o1 o2) @@ - lazy (compare_flat_combined_relation y1 y2) - ) + compare_struct (compare_flat_combined_relation x1 x2) @@ + lazy (compare_struct (compare_logop o1 o2) @@ + lazy (compare_flat_combined_relation y1 y2)) and compare_cond : type a b. a cond -> b cond -> int = fun a b -> match a, b with - | Expr x, Expr y -> - compare_expression x y - | Expr _, _ -> -1 - | _, Expr _ -> 1 - | Relation x, Relation y -> compare_binary_relation x y - | Relation _, _ -> -1 - | _, Relation _ -> 1 - | Abbrev x, Abbrev y -> compare_abbrev_combined_relation x y - | Abbrev _, _ -> -1 - | _, Abbrev _ -> 1 - | ClassCond (x1, c1), ClassCond (x2, c2) -> - compare_struct (compare_expression x1 x2) @@ lazy (compare_class_ c1 c2) - | ClassCond _, _ -> -1 - | _, ClassCond _ -> 1 - | SignCond (x1, s1), SignCond(x2, s2) -> - compare_struct (compare_expression x1 x2) @@ lazy (compare_signz s1 s2) - | SignCond _, _ -> -1 - | _, SignCond _ -> 1 - | Omitted x, Omitted y -> - compare_expression x y - | Omitted _, _ -> -1 - | _, Omitted _ -> 1 - | Not x, Not y -> - compare_cond x y - | Not _, _ -> -1 - | _, Not _ -> 1 - | Logop (x1, o1, y1), Logop (x2, o2, y2) -> - compare_struct (compare_logop o1 o2) @@ lazy ( - compare_struct (compare_cond x1 x2) @@ lazy ( - compare_cond y1 y2 - ) - ) + | Expr x, Expr y -> + compare_expression x y + | Expr _, _ -> -1 + | _, Expr _ -> 1 + | Relation x, Relation y -> compare_binary_relation x y + | Relation _, _ -> -1 + | _, Relation _ -> 1 + | Abbrev x, Abbrev y -> compare_abbrev_combined_relation x y + | Abbrev _, _ -> -1 + | _, Abbrev _ -> 1 + | ClassCond (x1, c1), ClassCond (x2, c2) -> + compare_struct (compare_expression x1 x2) @@ + lazy (compare_class_ c1 c2) + | ClassCond _, _ -> -1 + | _, ClassCond _ -> 1 + | SignCond (x1, s1), SignCond(x2, s2) -> + compare_struct (compare_expression x1 x2) @@ + lazy (compare_signz s1 s2) + | SignCond _, _ -> -1 + | _, SignCond _ -> 1 + | Omitted x, Omitted y -> + compare_expression x y + | Omitted _, _ -> -1 + | _, Omitted _ -> 1 + | Not x, Not y -> + compare_cond x y + | Not _, _ -> -1 + | _, Not _ -> 1 + | Logop (x1, o1, y1), Logop (x2, o2, y2) -> + compare_struct (compare_logop o1 o2) @@ + lazy (compare_struct (compare_cond x1 x2) @@ + lazy (compare_cond y1 y2)) and compare_relop = Stdlib.compare and compare_logop = Stdlib.compare and compare_class_ a b = match a, b with | AlphabetOrClass n1, AlphabetOrClass n2 -> - compare_with_loc_name n1 n2 + compare_with_loc compare_name n1 n2 | a, b -> Stdlib.compare a b and compare_qualident @@ -485,8 +486,9 @@ module COMPARE = struct compare_expression a b | SubSIdx(n1, s1, i1), SubSIdx(n2, s2, i2) -> - compare_struct (compare_with_loc_name n1 n2) @@ - lazy (compare_struct (compare_sign s1 s2) @@ lazy (compare i1 i2)) + compare_struct (compare_with_loc compare_name n1 n2) @@ + lazy (compare_struct (compare_sign s1 s2) @@ + lazy (compare i1 i2)) | a, b -> Stdlib.compare a b and compare_refmod @@ -498,19 +500,20 @@ module COMPARE = struct and compare_signz : loose_ sign_cond compare_fun = compare and compare_object_ref x y = match x, y with | Super a, Super b -> - Option.compare compare_with_loc_name a b + Option.compare (compare_with_loc compare_name) a b | a, b -> Stdlib.compare a b and compare_object_view { object_view_ident = a; object_view_spec = c } { object_view_ident = b; object_view_spec = d } = - compare_struct (compare_ident a b) @@ lazy (compare_object_view_spec c d) + compare_struct (compare_ident a b) @@ + lazy (compare_object_view_spec c d) and compare_object_view_spec x y = match x, y with | ObjViewAmbiguous a , ObjViewAmbiguous b | ObjViewFactory a, ObjViewFactory b | ObjViewOnly a, ObjViewOnly b | ObjViewFactoryOnly a, ObjViewFactoryOnly b -> - compare_with_loc_name a b + compare_with_loc compare_name a b | a, b -> compare a b and compare_inline_invoke @@ -522,7 +525,7 @@ module COMPARE = struct and compare_inline_call { call_fun = a; call_args = c } { call_fun = b; call_args = d } = - compare_struct (compare_with_loc_name a b) @@ + compare_struct (compare_with_loc compare_name a b) @@ lazy (List.compare compare_effective_arg c d) and compare_effective_arg x y = match x, y with | ArgExpr a, ArgExpr b -> @@ -544,7 +547,7 @@ module COMPARE = struct { counter_kind = a; counter_name = c } { counter_kind = b; counter_name = d } = compare_struct (Stdlib.compare a b) @@ - lazy (Option.compare (compare_with_loc_name) c d) + lazy (Option.compare (compare_with_loc compare_name) c d) and compare_ident: ident compare_fun = fun a b -> compare_term a b diff --git a/src/lsp/cobol_unit/unit_qual.ml b/src/lsp/cobol_unit/unit_qual.ml index c09d5227d..efbf20fe5 100644 --- a/src/lsp/cobol_unit/unit_qual.ml +++ b/src/lsp/cobol_unit/unit_qual.ml @@ -19,18 +19,19 @@ open Cobol_common.Srcloc.INFIX (* --- *) let pp = Cobol_ptree.pp_qualname +let compare = Cobol_ptree.compare_qualname let name n : Cobol_ptree.qualname = Name n let name_of : Cobol_ptree.qualname -> string = function - | Qual (n, _) | Name n -> ~&n + | Qual (n, _) | Name n -> String.uppercase_ascii ~&n let qual_of : Cobol_ptree.qualname -> _ option = function | Qual (_, qn) -> Some qn | Name _ -> None let qual name : Cobol_ptree.qualname option -> Cobol_ptree.qualname = function - | None -> Cobol_ptree.Name name - | Some qn -> Cobol_ptree.Qual (name, qn) + | None -> Name name + | Some qn -> Qual (name, qn) (** [requal qn qn'] qualifies [qn] with [qn'] iff [qn] is not already qualified. *) @@ -45,8 +46,8 @@ let requal: (Cobol_ptree.qualname as 'a) -> 'a option -> 'a = fun qn qn' -> let names_of : Cobol_ptree.qualname -> StrSet.t = let rec aux acc : Cobol_ptree.qualname -> StrSet.t = function - | Name n -> StrSet.add ~&n acc - | Qual (n, qn) -> aux (StrSet.add ~&n acc) qn + | Name _ as n -> StrSet.add (name_of n) acc + | Qual (_, qn) as n -> aux (StrSet.add (name_of n) acc) qn in aux StrSet.empty @@ -54,14 +55,17 @@ let indirect_quals_of : Cobol_ptree.qualname -> StrSet.t = function | Name _ -> StrSet.empty | Qual (_, qn) -> names_of qn -let compare = Cobol_ptree.compare_qualname - let rec matches (qn: Cobol_ptree.qualname) ~(full: Cobol_ptree.qualname) = match qn, full with - | Name n, Name n' -> ~&n = ~&n' - | Qual _, Name _ -> false - | Qual (n, qn), Qual (n', qn') when ~&n = ~&n' -> matches qn ~full:qn' - | qn, Qual (_, qn') -> matches qn ~full:qn' + | Name _, Name _ -> + name_of qn = name_of full + | Qual _, Name _ -> + false + | Qual (_, qn'), Qual (_, full') + when name_of qn = name_of full -> + matches qn' ~full:full' + | qn, Qual (_, full') -> + matches qn ~full:full' (** {1 Collections} *) diff --git a/test/lsp/lsp_definition.ml b/test/lsp/lsp_definition.ml index 278fbf562..63b045fcb 100644 --- a/test/lsp/lsp_definition.ml +++ b/test/lsp/lsp_definition.ml @@ -521,17 +521,17 @@ let%expect_test "definition-ambiguous-section/paragraphs" = print_definitions ~projdir server @@ extract_position_markers {cobol| PROGRAM-ID. prog. PROCEDURE DIVISION. - MAIN SECTION. + main SECTION. PERFORM SU_|_B-1. - MAIN-1 SECTION. - SUB-1. + main-1 SECTION. + sub-1. DISPLAY 1. - MAIN-2 SECTION. - SUB-1. + main-2 SECTION. + sub-1. DISPLAY 2. |cobol}; end_with_postproc [%expect.output]; - [%expect {| {"params":{"diagnostics":[{"message":"Ambiguous procedure-name 'SUB-1'; known matching names are 'SUB-1 IN MAIN-2', 'SUB-1 IN MAIN-1'","range":{"end":{"character":23,"line":4},"start":{"character":18,"line":4}},"severity":1}],"uri":"file://__rootdir__/prog.cob"},"method":"textDocument/publishDiagnostics","jsonrpc":"2.0"} |}];; + [%expect {| {"params":{"diagnostics":[{"message":"Ambiguous procedure-name 'SUB-1'; known matching names are 'sub-1 IN main-2', 'sub-1 IN main-1'","range":{"end":{"character":23,"line":4},"start":{"character":18,"line":4}},"severity":1}],"uri":"file://__rootdir__/prog.cob"},"method":"textDocument/publishDiagnostics","jsonrpc":"2.0"} |}];; @@ -541,22 +541,22 @@ let%expect_test "definition-malformed-qualifiers" = PROGRAM-ID. prog. PROCEDURE DIVISION. MAIN SECTION. - GO TO _|1-a|_A IN + GO TO _|1-a|_a IN PERFORM _|1-s|_S IN - PERFORM _|2-s|_S IN_|3-s|_ IN M_|4-main|_AIN - PERFORM _|5-s|_IN S_|6-s|_. + PERFORM _|2-s|_S IN_|3-s|_ IN m_|4-main|_ain + PERFORM _|5-s|_IN s_|6-s|_. |cobol}; end_with_postproc [%expect.output]; [%expect {| - {"params":{"diagnostics":[{"message":"Unknown procedure-name 'S'","range":{"end":{"character":23,"line":7},"start":{"character":22,"line":7}},"severity":1},{"message":"Unknown procedure-name 'S IN MAIN'","range":{"end":{"character":31,"line":6},"start":{"character":19,"line":6}},"severity":1},{"message":"Unknown procedure-name 'S'","range":{"end":{"character":23,"line":5},"start":{"character":19,"line":5}},"severity":1},{"message":"Unknown procedure-name 'A'","range":{"end":{"character":21,"line":4},"start":{"character":17,"line":4}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":21,"line":7},"start":{"character":19,"line":7}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":26,"line":6},"start":{"character":24,"line":6}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":18,"line":6},"start":{"character":11,"line":6}},"severity":1},{"message":"Missing ","range":{"end":{"character":23,"line":5},"start":{"character":23,"line":5}},"severity":4},{"message":"Invalid syntax","range":{"end":{"character":18,"line":5},"start":{"character":11,"line":5}},"severity":1},{"message":"Missing ","range":{"end":{"character":21,"line":4},"start":{"character":21,"line":4}},"severity":4}],"uri":"file://__rootdir__/prog.cob"},"method":"textDocument/publishDiagnostics","jsonrpc":"2.0"} + {"params":{"diagnostics":[{"message":"Unknown procedure-name 's'","range":{"end":{"character":23,"line":7},"start":{"character":22,"line":7}},"severity":1},{"message":"Unknown procedure-name 'S IN main'","range":{"end":{"character":31,"line":6},"start":{"character":19,"line":6}},"severity":1},{"message":"Unknown procedure-name 'S'","range":{"end":{"character":23,"line":5},"start":{"character":19,"line":5}},"severity":1},{"message":"Unknown procedure-name 'a'","range":{"end":{"character":21,"line":4},"start":{"character":17,"line":4}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":21,"line":7},"start":{"character":19,"line":7}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":26,"line":6},"start":{"character":24,"line":6}},"severity":1},{"message":"Invalid syntax","range":{"end":{"character":18,"line":6},"start":{"character":11,"line":6}},"severity":1},{"message":"Missing ","range":{"end":{"character":23,"line":5},"start":{"character":23,"line":5}},"severity":4},{"message":"Invalid syntax","range":{"end":{"character":18,"line":5},"start":{"character":11,"line":5}},"severity":1},{"message":"Missing ","range":{"end":{"character":21,"line":4},"start":{"character":21,"line":4}},"severity":4}],"uri":"file://__rootdir__/prog.cob"},"method":"textDocument/publishDiagnostics","jsonrpc":"2.0"} 1-a (line 4, character 17): - {"params":{"message":"Unknown procedure-name 'A'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} + {"params":{"message":"Unknown procedure-name 'a'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} No definition found 1-s (line 5, character 19): {"params":{"message":"Unknown procedure-name 'S'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} No definition found 2-s (line 6, character 19): - {"params":{"message":"Unknown procedure-name 'S IN MAIN'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} + {"params":{"message":"Unknown procedure-name 'S IN main'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} No definition found 3-s (line 6, character 23): __rootdir__/prog.cob:4.7-4.11: @@ -565,7 +565,7 @@ let%expect_test "definition-malformed-qualifiers" = 3 PROCEDURE DIVISION. 4 > MAIN SECTION. ---- ^^^^ - 5 GO TO A IN + 5 GO TO a IN 6 PERFORM S IN 4-main (line 6, character 28): __rootdir__/prog.cob:4.7-4.11: @@ -574,12 +574,12 @@ let%expect_test "definition-malformed-qualifiers" = 3 PROCEDURE DIVISION. 4 > MAIN SECTION. ---- ^^^^ - 5 GO TO A IN + 5 GO TO a IN 6 PERFORM S IN 5-s (line 7, character 19): No definition found 6-s (line 7, character 23): - {"params":{"message":"Unknown procedure-name 'S'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} + {"params":{"message":"Unknown procedure-name 's'","type":2},"method":"window/showMessage","jsonrpc":"2.0"} No definition found |}];; @@ -590,14 +590,14 @@ let%expect_test "definition-index" = PROGRAM-ID. prog. DATA DIVISION. WORKING-STORAGE SECTION. - 77 V-TAB PIC X OCCURS 5 INDEXED I _|1-j|_J. + 77 V-Tab PIC X OCCURS 5 INDEXED i _|1-j|_j. 01 W. - 02 W-TAB PIC 9 OCCURS 42 INDEXED J_|2-j|_ K. + 02 W-TAB PIC 9 OCCURS 42 INDEXED j_|2-j|_ k. PROCEDURE DIVISION. SET _|3-i|_I IN V-TAB TO 0 - SET _|4-j|_J IN W TO 0 + SET _|4-j|_J IN w TO 0 SET _|5-k|_K IN W-TAB IN W TO 0 - SET _|6-missing|_L IN W-TAB IN W TO 0 + SET _|6-missing|_L IN w-tab IN W TO 0 |cobol}; end_with_postproc [%expect.output]; [%expect {| @@ -607,16 +607,16 @@ let%expect_test "definition-index" = 2 PROGRAM-ID. prog. 3 DATA DIVISION. 4 WORKING-STORAGE SECTION. - 5 > 77 V-TAB PIC X OCCURS 5 INDEXED I J. + 5 > 77 V-Tab PIC X OCCURS 5 INDEXED i j. ---- ^ 6 01 W. - 7 02 W-TAB PIC 9 OCCURS 42 INDEXED J K. + 7 02 W-TAB PIC 9 OCCURS 42 INDEXED j k. 2-j (line 6, character 43): __rootdir__/prog.cob:7.42-7.43: 4 WORKING-STORAGE SECTION. - 5 77 V-TAB PIC X OCCURS 5 INDEXED I J. + 5 77 V-Tab PIC X OCCURS 5 INDEXED i j. 6 01 W. - 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED J K. + 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED j k. ---- ^ 8 PROCEDURE DIVISION. 9 SET I IN V-TAB TO 0 @@ -625,25 +625,25 @@ let%expect_test "definition-index" = 2 PROGRAM-ID. prog. 3 DATA DIVISION. 4 WORKING-STORAGE SECTION. - 5 > 77 V-TAB PIC X OCCURS 5 INDEXED I J. + 5 > 77 V-Tab PIC X OCCURS 5 INDEXED i j. ---- ^ 6 01 W. - 7 02 W-TAB PIC 9 OCCURS 42 INDEXED J K. + 7 02 W-TAB PIC 9 OCCURS 42 INDEXED j k. 4-j (line 9, character 15): __rootdir__/prog.cob:7.42-7.43: 4 WORKING-STORAGE SECTION. - 5 77 V-TAB PIC X OCCURS 5 INDEXED I J. + 5 77 V-Tab PIC X OCCURS 5 INDEXED i j. 6 01 W. - 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED J K. + 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED j k. ---- ^ 8 PROCEDURE DIVISION. 9 SET I IN V-TAB TO 0 5-k (line 10, character 15): __rootdir__/prog.cob:7.44-7.45: 4 WORKING-STORAGE SECTION. - 5 77 V-TAB PIC X OCCURS 5 INDEXED I J. + 5 77 V-Tab PIC X OCCURS 5 INDEXED i j. 6 01 W. - 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED J K. + 7 > 02 W-TAB PIC 9 OCCURS 42 INDEXED j k. ---- ^ 8 PROCEDURE DIVISION. 9 SET I IN V-TAB TO 0