Merge "Handles if a space is encountered while parsing the rule" into main am: 3e8bd45638
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2975671 Change-Id: Ifc9741be2b54da07aebdb11ff71e8c7df749124e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -413,6 +413,9 @@ loop:
|
|||||||
p.accept('\t')
|
p.accept('\t')
|
||||||
newLine = false
|
newLine = false
|
||||||
continue loop
|
continue loop
|
||||||
|
} else if p.tok == '\n' {
|
||||||
|
p.accept('\n')
|
||||||
|
continue loop
|
||||||
} else if p.parseDirective() {
|
} else if p.parseDirective() {
|
||||||
newLine = false
|
newLine = false
|
||||||
continue
|
continue
|
||||||
|
@@ -84,6 +84,22 @@ endif`,
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "Blank line in rule's command",
|
||||||
|
in: `all:
|
||||||
|
echo first line
|
||||||
|
|
||||||
|
echo second line`,
|
||||||
|
out: []Node{
|
||||||
|
&Rule{
|
||||||
|
Target: SimpleMakeString("all", NoPos),
|
||||||
|
RecipePos: NoPos,
|
||||||
|
Recipe: "echo first line\necho second line",
|
||||||
|
Prerequisites: SimpleMakeString("", NoPos),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user