summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAndreas Scherer <andreas_tex@freenet.de>2022-02-19 14:47:45 +0000
committerAndreas Scherer <andreas_tex@freenet.de>2022-02-19 14:47:45 +0000
commit0b7885c804ec25f34fda3850dc3eb5c2ad4a77ef (patch)
tree7b742ca6a366b92e7b5a6bc52e0c8495d29bd729 /Build
parentf24f04a22ae783e1c347ec69b2c1f23606c1dcf8 (diff)
[CWEB] Permit indentation of preprocessing directives.
The C processor allows whitespace before and after the '#' of preprocessing directives, e.g., some MetaPost code uses this feature. In order to permit more liberal code layout, we only expect the '#' to be the first character in the buffer, followed by some optional whitespace. CWEB takes care that 'id_first' is the first non-whitespace character in the 'buffer' (and 'id_loc' is the first character _after_ the directive name). git-svn-id: svn://tug.org/texlive/trunk@62084 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/ctangleboot.cin2
-rw-r--r--Build/source/texk/web2c/cwebdir/ctangle.c2
-rw-r--r--Build/source/texk/web2c/cwebdir/ctangle.w2
3 files changed, 3 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/ctangleboot.cin b/Build/source/texk/web2c/ctangleboot.cin
index c835052d64a..5d0b10ec927 100644
--- a/Build/source/texk/web2c/ctangleboot.cin
+++ b/Build/source/texk/web2c/ctangleboot.cin
@@ -1599,7 +1599,7 @@ while(true)switch(a= get_next()){
#line 1244 "cwebdir/ctangle.w"
case identifier:store_id(a);
-if(*buffer=='#'&&id_first==buffer+1&&(
+if(*buffer=='#'&&(
(id_loc-id_first==5&&strncmp("endif",id_first,5)==0)||
(id_loc-id_first==4&&strncmp("else",id_first,4)==0)||
(id_loc-id_first==4&&strncmp("elif",id_first,4)==0)))
diff --git a/Build/source/texk/web2c/cwebdir/ctangle.c b/Build/source/texk/web2c/cwebdir/ctangle.c
index 7677ce1f323..b6037a87dd9 100644
--- a/Build/source/texk/web2c/cwebdir/ctangle.c
+++ b/Build/source/texk/web2c/cwebdir/ctangle.c
@@ -1282,7 +1282,7 @@ while(true)switch(a= get_next()){
#line 1244 "ctangle.w"
case identifier:store_id(a);
-if(*buffer=='#'&&id_first==buffer+1&&(
+if(*buffer=='#'&&(
(id_loc-id_first==5&&strncmp("endif",id_first,5)==0)||
(id_loc-id_first==4&&strncmp("else",id_first,4)==0)||
(id_loc-id_first==4&&strncmp("elif",id_first,4)==0)))
diff --git a/Build/source/texk/web2c/cwebdir/ctangle.w b/Build/source/texk/web2c/cwebdir/ctangle.w
index 62d12290ff8..c2fc88af747 100644
--- a/Build/source/texk/web2c/cwebdir/ctangle.w
+++ b/Build/source/texk/web2c/cwebdir/ctangle.w
@@ -1243,7 +1243,7 @@ file name.
@ @<In cases that |a| is...@>=@t\1\quad@>
case identifier: store_id(a);
- if (*buffer=='#' && id_first==buffer+1 && @| (
+ if (*buffer=='#' && @| (
( id_loc-id_first==5 && strncmp("endif",id_first,5)==0 ) || @|
( id_loc-id_first==4 && strncmp("else",id_first,4)==0 ) || @|
( id_loc-id_first==4 && strncmp("elif",id_first,4)==0 ) ) )