From patchwork Fri Dec 6 10:17:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1204975 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515328-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Z5xSvBH7"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47TpS14lYpz9sPJ for ; Fri, 6 Dec 2019 21:17:37 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=U+MuYwBQHtERh/OgW49xv60NqiOFE5Q9ZNs8cJWgs9stFds1h34Wu Ji2XpA9gB04wvZlkSTQMf9/JsZhDlXNmOceHDb1BLs9G48VE4tEGSSwvdKxe/uFd w7ZUXma63shIuMqDqqULurRksexdV7OrN8BtoxutzkmDn2mn69oSgg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=m0ywDVrNXlaTzIDvU1Gj7GqRd0c=; b=Z5xSvBH7epcZv5JJwdcf tWS2nGTsAoKKlv0g6faHDqfV8s3R17QVQmyQ3fm8Iu8/nGHSjplBdI+rbFUhNQ5a paLN4v6xo3ZG+hcUG0twEsHfWxlA/Y2Hflo1nSF62pxb8McGTVydXBpAXEtSIFm0 FdiRcBsC8Nt+TBf02PFTPJ4= Received: (qmail 125806 invoked by alias); 6 Dec 2019 10:17:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 125798 invoked by uid 89); 6 Dec 2019 10:17:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=inherited, HX-Languages-Length:2116 X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.110.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 10:17:29 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7102ADA7 for ; Fri, 6 Dec 2019 02:17:27 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 18DAB3F718 for ; Fri, 6 Dec 2019 02:17:26 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: Fix @multitable handling in texi2pod.pl Date: Fri, 06 Dec 2019 10:17:25 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes While trying out Dennis's Armv8.6-A patch, I noticed that texi2pod.pl didn't handle the new @multitable correctly. There were two problems: (1) @multitables nested in other @tables inherited the @item type from the enclosing @table. Since the new @multitable is in a @table @samp, we applied @samp markup to the @multitable @items. This in turn meant that it captured the @tab separator in the @item markup. Fixed by pushing an empty item code onto the stack. (2) We didn't handle @headitem. Fixed by enclosing it in italics, like we do for section headings. This causes it to be underlined in the man output. Tested by making sure that it doesn't change the current gcc.pod output, but fixes the problems mentioned above when the new @multitable is added. OK to install? Richard 2019-12-05 Richard Sandiford contrib/ * texi2pod.pl: Handle @headitems in @multitables, printing them in italics. Push an empty item code onto the stack. Index: contrib/texi2pod.pl =================================================================== --- contrib/texi2pod.pl 2019-03-08 18:14:23.345019203 +0000 +++ contrib/texi2pod.pl 2019-12-06 10:15:24.968809478 +0000 @@ -164,6 +164,7 @@ while(<$inf>) { $ic = pop @icstack; } elsif ($ended eq "multitable") { $_ = "\n=back\n"; + $ic = pop @icstack; } else { die "unknown command \@end $ended at line $.\n"; } @@ -288,7 +289,9 @@ while(<$inf>) { /^\@multitable\s.*/ and do { push @endwstack, $endw; + push @icstack, $ic; $endw = "multitable"; + $ic = ""; $_ = "\n=over 4\n"; }; @@ -312,11 +315,13 @@ while(<$inf>) { $_ = ""; # need a paragraph break }; - /^\@item\s+(.*\S)\s*$/ and $endw eq "multitable" and do { + /^\@(headitem|item)\s+(.*\S)\s*$/ and $endw eq "multitable" and do { @columns = (); - for $column (split (/\s*\@tab\s*/, $1)) { + $item = $1; + for $column (split (/\s*\@tab\s*/, $2)) { # @strong{...} is used a @headitem work-alike $column =~ s/^\@strong\{(.*)\}$/$1/; + $column = "I<$column>" if $item eq "headitem"; push @columns, $column; } $_ = "\n=item ".join (" : ", @columns)."\n";