Merge "Parse else ifxxx statement"
This commit is contained in:
commit
725af86fe7
|
@ -212,8 +212,21 @@ func (p *parser) parseDirective() bool {
|
|||
expression := SimpleMakeString("", pos)
|
||||
|
||||
switch d {
|
||||
case "endif", "endef", "else":
|
||||
case "endif", "endef":
|
||||
// Nothing
|
||||
case "else":
|
||||
p.ignoreSpaces()
|
||||
if p.tok != '\n' {
|
||||
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()
|
||||
} else {
|
||||
p.errorf("expected ifdef/ifndef/ifeq/ifneq, found %s", d)
|
||||
}
|
||||
}
|
||||
case "define":
|
||||
expression, endPos = p.parseDefine()
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue