Skip to content

Commit

Permalink
Merge branch 'gnucobol-3.x' into gcos4gnucobol-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lefessan committed Jul 3, 2023
2 parents 57e7a28 + 097a4ec commit 4b8452a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
7 changes: 7 additions & 0 deletions cobc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

2023-07-03 Simon Sobisch <[email protected]>

* pplex.l (check_listing): rewrite of change 2022-07-04:
do not output sequence number of short lines,
but keep its line break and the general output
* pplex.l: drop unused "requires_new_line" (added without use in OC2.0)

2023-07-01 Simon Sobisch <[email protected]>

* scanner.l: add check for reserved word FUNCTION, add missing
Expand Down
19 changes: 9 additions & 10 deletions cobc/pplex.l
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static unsigned int plex_nest_depth = 0;
static int quotation_mark = 0;
static int listing_line = 0;
static int requires_listing_line;
static int requires_new_line = 0;
static enum cb_format source_format = CB_FORMAT_AUTO;
static int indicator_column = 7;
static int text_column = 72; /* end of area B (in single-byte
Expand Down Expand Up @@ -1079,7 +1078,6 @@ ENDIF_DIRECTIVE_STATE>{
cobc_free (current_copy_info);
listing_line = 0;
requires_listing_line = 1;
requires_new_line = 0;
need_continuation = 0;
buffer_overflow = 0;
within_comment = 0;
Expand Down Expand Up @@ -2868,19 +2866,20 @@ check_listing (const char *text, const unsigned int comment)
}

if (requires_listing_line) {
if (requires_new_line) {
requires_new_line = 0;
putc ('\n', cb_listing_file);
}
fprintf (cb_listing_file, "%6d%c", ++listing_line, c);
}

if (requires_listing_line
&& source_format != CB_FORMAT_FREE
&& strlen (text) >= (size_t)indicator_column) {
s = &text[indicator_column - 1];
&& source_format != CB_FORMAT_FREE) {
if (strlen (text) >= (size_t)indicator_column) {
s = text + indicator_column - 1;
} else if (strchr (text, '\n')) {
s = "\n"; /* no sequence area, but line break */
} else {
s = ""; /* do not output sequence area */
}
} else {
s = ""; /* do not output sequence area */
s = text;
}
fputs (s, cb_listing_file);
if (strchr (text, '\n')) {
Expand Down

0 comments on commit 4b8452a

Please sign in to comment.