summaryrefslogtreecommitdiff
path: root/androidmk/parser/parser.go
diff options
context:
space:
mode:
author Sasha Smundak <asmundak@google.com> 2020-11-05 20:45:07 -0800
committer Sasha Smundak <asmundak@google.com> 2021-07-14 09:51:10 -0700
commitb051c4ede37e33bfb7c56e8c6fcf0ab010915fc4 (patch)
treeed05d7c92b848efc6d6985d5314528085b64fcad /androidmk/parser/parser.go
parente04058f291041531ed45b4d4da2eaea647dcb942 (diff)
Product config makefiles to Starlark converter
Test: treehugger; internal tests in mk2rbc_test.go Bug: 172923994 Change-Id: I43120b9c181ef2b8d9453e743233811b0fec268b
Diffstat (limited to 'androidmk/parser/parser.go')
-rw-r--r--androidmk/parser/parser.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/androidmk/parser/parser.go b/androidmk/parser/parser.go
index 5afef652a..d24efc10d 100644
--- a/androidmk/parser/parser.go
+++ b/androidmk/parser/parser.go
@@ -216,13 +216,14 @@ func (p *parser) parseDirective() bool {
// Nothing
case "else":
p.ignoreSpaces()
- if p.tok != '\n' {
+ if p.tok != '\n' && p.tok != '#' {
d = p.scanner.TokenText()
p.accept(scanner.Ident)
if d == "ifdef" || d == "ifndef" || d == "ifeq" || d == "ifneq" {
d = "el" + d
p.ignoreSpaces()
expression = p.parseExpression()
+ expression.TrimRightSpaces()
} else {
p.errorf("expected ifdef/ifndef/ifeq/ifneq, found %s", d)
}