diff --git a/builder/parser/parser.go b/builder/parser/parser.go index c24a925e43..f016f2598b 100644 --- a/builder/parser/parser.go +++ b/builder/parser/parser.go @@ -32,7 +32,7 @@ type Node struct { var ( dispatch map[string]func(string) (*Node, map[string]bool, error) TOKEN_WHITESPACE = regexp.MustCompile(`[\t\v\f\r ]+`) - TOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\$`) + TOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\\s*$`) TOKEN_COMMENT = regexp.MustCompile(`^#.*$`) ) diff --git a/builder/parser/testfiles/continueIndent/Dockerfile b/builder/parser/testfiles/continueIndent/Dockerfile index 6ce6c06fb7..57a6bca92a 100644 --- a/builder/parser/testfiles/continueIndent/Dockerfile +++ b/builder/parser/testfiles/continueIndent/Dockerfile @@ -14,6 +14,7 @@ RUN echo hello \ goodbye\ frog RUN echo hello \ +world RUN echo hi \ \ world \ diff --git a/builder/parser/testfiles/continueIndent/result b/builder/parser/testfiles/continueIndent/result index e440b836d4..8c67707706 100644 --- a/builder/parser/testfiles/continueIndent/result +++ b/builder/parser/testfiles/continueIndent/result @@ -3,7 +3,7 @@ (run "echo hello world") (run "echo hello world") (run "echo hello goodbyefrog") -(run "echo hello \\") +(run "echo hello world") (run "echo hi world goodnight") (run "echo goodbyefrog") (run "echo goodbyefrog")