From b7bcf49446150838af3c7cd1dec335ba45a2fc6b Mon Sep 17 00:00:00 2001 From: Peter Prymmer Date: Thu, 14 Jun 2001 09:25:33 -0700 Subject: handle tri graphs in h2ph.PL -> h2ph* Message-ID: p4raw-id: //depot/perl@10605 --- utils/h2ph.PL | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'utils') 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 .= ; @@ -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; # | ??>| }| + } if ($in =~ s/\\$//) { # \-newline $out .= ' '; next READ; -- cgit v1.2.1