diff options
author | Peter Prymmer <PPrymmer@factset.com> | 2001-06-14 09:25:33 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-15 13:49:55 +0000 |
commit | b7bcf49446150838af3c7cd1dec335ba45a2fc6b (patch) | |
tree | 73555e583d3a9108aaf921a40707eea8961efc8c /utils/h2ph.PL | |
parent | 8999201bab63458618adf26ec16c87a4d7bec076 (diff) | |
download | perl-b7bcf49446150838af3c7cd1dec335ba45a2fc6b.tar.gz |
handle tri graphs in h2ph.PL -> h2ph*
Message-ID: <Pine.OSF.4.10.10106141608080.110974-100000@aspara.forte.com>
p4raw-id: //depot/perl@10605
Diffstat (limited to 'utils/h2ph.PL')
-rw-r--r-- | utils/h2ph.PL | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/utils/h2ph.PL b/utils/h2ph.PL index d852fc2422..f647831a53 100644 --- a/utils/h2ph.PL +++ b/utils/h2ph.PL @@ -401,6 +401,7 @@ sub expr { sub next_line { my ($in, $out); + my $pre_sub_tri_graphs = 1; READ: while (not eof IN) { $in .= <IN>; @@ -408,6 +409,19 @@ sub next_line next unless length $in; while (length $in) { + if ($pre_sub_tri_graphs) { + # Preprocess all tri-graphs + # including things stuck in quoted string constants. + $in =~ s/\?\?=/#/g; # | ??=| #| + $in =~ s/\?\?\!/|/g; # | ??!| || + $in =~ s/\?\?'/^/g; # | ??'| ^| + $in =~ s/\?\?\(/[/g; # | ??(| [| + $in =~ s/\?\?\)/]/g; # | ??)| ]| + $in =~ s/\?\?\-/~/g; # | ??-| ~| + $in =~ s/\?\?\//\\/g; # | ??/| \| + $in =~ s/\?\?</{/g; # | ??<| {| + $in =~ s/\?\?>/}/g; # | ??>| }| + } if ($in =~ s/\\$//) { # \-newline $out .= ' '; next READ; |