|
| 1 | +From 4f81a7293993211ae31970c5a349565dcd1faf21 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Javier Maestro <jjmaestro@ieee.org> |
| 3 | +Date: Fri, 16 May 2025 13:47:11 -0400 |
| 4 | +Subject: [PATCH] backport: noline for %top directives |
| 5 | + |
| 6 | +See https://github.com/westes/flex/pull/704 |
| 7 | +--- |
| 8 | + src/scan.c | 4 +++- |
| 9 | + src/scan.l | 4 +++- |
| 10 | + 2 files changed, 6 insertions(+), 2 deletion(-) |
| 11 | + |
| 12 | +diff --git a/src/scan.c b/src/scan.c |
| 13 | +index 66db864..5e750fb 100644 |
| 14 | +--- a/src/scan.c |
| 15 | ++++ b/src/scan.c |
| 16 | +@@ -2326,7 +2326,9 @@ |
| 17 | + { |
| 18 | + brace_start_line = linenum; |
| 19 | + ++linenum; |
| 20 | +- buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum); |
| 21 | ++ // backporting https://github.com/westes/flex/pull/704/ |
| 22 | ++ if (gen_line_dirs) |
| 23 | ++ buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum); |
| 24 | + brace_depth = 1; |
| 25 | + yy_push_state(CODEBLOCK_MATCH_BRACE); |
| 26 | + } |
| 27 | +diff --git a/src/scan.l b/src/scan.l |
| 28 | +index 66db864..5e750fb 100644 |
| 29 | +--- a/src/scan.l |
| 30 | ++++ b/src/scan.l |
| 31 | +@@ -175,7 +175,9 @@ M4QEND "]""]" |
| 32 | + ^"%top"[[:blank:]]*"{"[[:blank:]]*{NL} { |
| 33 | + brace_start_line = linenum; |
| 34 | + ++linenum; |
| 35 | +- buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum); |
| 36 | ++ // backporting https://github.com/westes/flex/pull/704/ |
| 37 | ++ if (gen_line_dirs) |
| 38 | ++ buf_linedir( &top_buf, infilename?infilename:"<stdin>", linenum); |
| 39 | + brace_depth = 1; |
| 40 | + yy_push_state(CODEBLOCK_MATCH_BRACE); |
| 41 | + } |
| 42 | +-- |
| 43 | +2.39.5 (Apple Git-154) |
| 44 | + |
0 commit comments