1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

builder: Handle trailing \ appropriately.

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

View file

@ -32,7 +32,7 @@ type Node struct {
var ( var (
dispatch map[string]func(string) (*Node, map[string]bool, error) dispatch map[string]func(string) (*Node, map[string]bool, error)
TOKEN_WHITESPACE = regexp.MustCompile(`[\t\v\f\r ]+`) TOKEN_WHITESPACE = regexp.MustCompile(`[\t\v\f\r ]+`)
TOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\$`) TOKEN_LINE_CONTINUATION = regexp.MustCompile(`\\\s*$`)
TOKEN_COMMENT = regexp.MustCompile(`^#.*$`) TOKEN_COMMENT = regexp.MustCompile(`^#.*$`)
) )

View file

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

View file

@ -3,7 +3,7 @@
(run "echo hello world") (run "echo hello world")
(run "echo hello world") (run "echo hello world")
(run "echo hello goodbyefrog") (run "echo hello goodbyefrog")
(run "echo hello \\") (run "echo hello world")
(run "echo hi world goodnight") (run "echo hi world goodnight")
(run "echo goodbyefrog") (run "echo goodbyefrog")
(run "echo goodbyefrog") (run "echo goodbyefrog")