From 5bd00bb54235856dddd11e9f0d03481c5469ca63 Mon Sep 17 00:00:00 2001 From: Saku Laesvuori Date: Sat, 2 Dec 2023 19:23:06 +0200 Subject: guix: import: Parse cabal layout blocks correctly Cabal consideres lines to be part of a layout block if they are indented at least one space more than the field line the block belongs to. Previously Guix considered lines to be a part of the block if they were indented at least as much as the first line in it. This also makes a workaround that enabled if statements to have multiple elses redundant and removes it. Fixes: https://issues.guix.gnu.org/35743 * guix/import/cabal.scm (current-indentation*): Renamed from current-indentation. (previous-indentation, current-indentation): New variables. (make-cabal-parser): Remove outdated comment. [open]: Use previous-indentation + 1 instead of current-indentation. [elif-else]: Split to elif and else to allow only one ELSE in an if statement. (read-cabal)[parameterize]: Use current-indentation* and previous-indentation. * tests/hackage.scm (hackage->guix-package test mixed layout): Expect to pass. Change-Id: I3a1495b1588a022fabbfe8dad9f3231e578af4f3 Signed-off-by: Lars-Dominik Braun --- tests/hackage.scm | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests') diff --git a/tests/hackage.scm b/tests/hackage.scm index 8eea818ebd..32e5f39329 100644 --- a/tests/hackage.scm +++ b/tests/hackage.scm @@ -306,8 +306,6 @@ executable cabal ghc-options: -Wall ") -;; Fails: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35743 -(test-expect-fail 1) (test-assert "hackage->guix-package test mixed layout" (eval-test-with-cabal test-cabal-mixed-layout match-ghc-foo)) -- cgit v1.2.3