builder: Handle trailing \ appropriately.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 7fa449191ce9abc3e0a5261b66d8338948f66940
Component: engine
This commit is contained in:
Erik Hollensbe
2014-10-15 03:08:04 +00:00
parent f5ae3b0b1b
commit 61f914763d
3 changed files with 3 additions and 2 deletions

View File

@ -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(`^#.*$`)
)

View File

@ -14,6 +14,7 @@ RUN echo hello \
goodbye\
frog
RUN echo hello \
world
RUN echo hi \
\
world \

View File

@ -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")