From patchwork Wed Sep 23 06:39:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Storsj=C3=B6?= X-Patchwork-Id: 22561 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 3C1DF44AF3F for ; Wed, 23 Sep 2020 09:45:22 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1533068B584; Wed, 23 Sep 2020 09:45:22 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 50C5D68029E for ; Wed, 23 Sep 2020 09:45:16 +0300 (EEST) Received: by mail-lf1-f65.google.com with SMTP id z19so20827940lfr.4 for ; Tue, 22 Sep 2020 23:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=martin-st.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=4wqEVpTJQN0IWhL4hbz/Q9xfVZLRK34VOkZ+MGjnM44=; b=EW+AiQ8CsxJW1QWe/ctysAwvNKB/MGw/tiXK+cnNDmZ0aoAY0bhhcTEczw3to90ULq 1Y/VX8yZlPW0UFmxUb6zZmEYT4gSA5dmSuEJRjXDOuWVgRmVPG7x6wJkjhrqiRza/DkB 3a21EfIpvarshVi4GF3gtUCfE+jx4FeXHgiSr9A3lcU96ap9mtjb8+cPz1jZjV3bOH2d f3XvltdI272XZJoHGEzpoT4egv6hPaInV9fO/irrIdodFVac/AEZoJ+dYAevmv+LFYCi IfGKLRXeu8aDf95mcdKMKhCUzE+UvEadzBAvq9AC/J4TYGFAwCYmyf02mNJWF9jERcBY Svww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=4wqEVpTJQN0IWhL4hbz/Q9xfVZLRK34VOkZ+MGjnM44=; b=NV3SrfuCsJwMTDOqToGskD/aynQ8E8yN+v0Y88i9bPfbAcsd7cToEsrcHinK726k+E 1m1hqgqKVdj10d1NW3XWgZLtlBywKKMCAY76cLIOIBshCPMNd5HeKPWEnqZ5j1uzPK1M jgdoGF4D7beeXjDrP3ZUDFfclZFYqx0K9LNo6JnSAFyXMT3UJ8fVCbxDXJ3DYbpSRsJu hP2NWkf0ym9wnnYSB2WTsd9C0bs/FE7zkR26rxK1XRlF+0FAkkOVBSdY67z0rOcS7mTN WUapeLpY153B+bbamIP3uxrX+DWMJV9Bthtqt8BEwN3R4lV10lFKCSKSUYP6CE4Cp//M ixVA== X-Gm-Message-State: AOAM532Izvn0NmZKrvLXWf/vFMe2ciags1hTHpEK/7d2TG6VmFk0OxR+ 3W0o0ZJDLwTVybkvuWXaKn5E6F4NCLFVuDaT X-Google-Smtp-Source: ABdhPJxTceo4xXv1sXLWDKNusB1Th0fG9uupS0LVuledJighhRH+FFCapSwctUBQcpssI7L59j6r8g== X-Received: by 2002:a05:6512:1090:: with SMTP id j16mr2610159lfg.3.1600843159801; Tue, 22 Sep 2020 23:39:19 -0700 (PDT) Received: from localhost.localdomain (dsl-tkubng21-58c01c-243.dhcp.inet.fi. [88.192.28.243]) by smtp.gmail.com with ESMTPSA id 138sm4343331lfl.241.2020.09.22.23.39.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 23:39:19 -0700 (PDT) From: =?utf-8?q?Martin_Storsj=C3=B6?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Sep 2020 09:39:16 +0300 Message-Id: <20200923063917.19016-1-martin@martin.st> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [GASPP PATCH 1/2] Handle line continuations within gas-preprocessor X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" If preprocessing with cl.exe, the preprocessor doesn't take care of concatenating continued lines. --- gas-preprocessor.pl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index 126ee50..e9baeba 100755 --- a/gas-preprocessor.pl +++ b/gas-preprocessor.pl @@ -295,12 +295,11 @@ while () { s/\r$//; foreach my $subline (split(";", $_)) { - # Add newlines at the end of lines that don't already have one chomp $subline; - $subline .= "\n"; - parse_line($subline); + parse_line_continued($subline); } } +parse_line_continued(""); sub eval_expr { my $expr = $_[0]; @@ -383,6 +382,20 @@ sub parse_if_line { return 0; } +my $last_line = ""; +sub parse_line_continued { + my $line = $_[0]; + $last_line .= $line; + if ($last_line =~ /\\$/) { + $last_line =~ s/\\$//; + } else { + # Add newlines at the end of lines after concatenation. + $last_line .= "\n"; + parse_line($last_line); + $last_line = ""; + } +} + sub parse_line { my $line = $_[0];