Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 53ca8b25 authored by Min Yun's avatar Min Yun
Browse files

Handles if a space is encountered while parsing the rule

kati and GNU make may have blank lines in the middle of commands declared in rules.
Add compatibility for this.

Change-Id: Iae03053c0cb901074c26420c0c6ac1c0e00d99de
parent f8c00426
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -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
+16 −0
Original line number Original line Diff line number Diff line
@@ -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) {