From 6ed516c2870fe60cdb8e81305807d2f4770ff2cb Mon Sep 17 00:00:00 2001
From: Yanis HAMOUDI <yanis.hamoudi@etu.u-pec.fr>
Date: Sun, 16 Mar 2025 18:12:37 +0100
Subject: [PATCH] correction bug

---
 src/fr/monlouyan/bakefile/BakefileParser.java | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/src/fr/monlouyan/bakefile/BakefileParser.java b/src/fr/monlouyan/bakefile/BakefileParser.java
index 4c70fc9..006ad05 100644
--- a/src/fr/monlouyan/bakefile/BakefileParser.java
+++ b/src/fr/monlouyan/bakefile/BakefileParser.java
@@ -407,6 +407,31 @@ public class BakefileParser {
 					}
 					
 					String depStr = targetMatcher.group(2);
+					
+					// Vérifier si la chaîne de dépendances se termine par un backslash (continuation)
+					if (depStr.trim().endsWith("\\")) {
+						StringBuilder fullDeps = new StringBuilder(depStr.substring(0, depStr.trim().length() - 1).trim());
+						int j = i + 1;
+						
+						while (j < lines.size()) {
+							String nextLine = lines.get(j).trim();
+							
+							if (nextLine.endsWith("\\")) {
+								fullDeps.append(" ").append(nextLine.substring(0, nextLine.length() - 1).trim());
+								j++;
+							} else {
+								fullDeps.append(" ").append(nextLine);
+								i = j; // Mettre à jour l'indice principal pour sauter les lignes traitées
+								break;
+							}
+						}
+						
+						depStr = fullDeps.toString();
+						if (BakeCLI.isDebug()) {
+							System.out.println("Debug: Combined dependency line: [" + depStr + "]");
+						}
+					}
+					
 					dependencies = splitDependencies(depStr);
 					commands = new ArrayList<>();
 					displayCommands = new ArrayList<>();