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<>();