Skip to content

Commit

Permalink
mparser: store subdir in ternary node
Browse files Browse the repository at this point in the history
Ternaries don't really need subdirs, but they can be passed into
functions that expect the type they're provided to have a
subdir. Provide it to fulful the interface.

Fixes mesonbuild#5003
Fixes mesonbuild#3690
Fixes mesonbuild#2404
  • Loading branch information
dcbaker committed Mar 2, 2019
1 parent cc069fd commit cfbba18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesonbuild/mparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ def __init__(self, lineno, colno, condition, block):
self.block = block

class TernaryNode(BaseNode):
def __init__(self, lineno, colno, condition, trueblock, falseblock):
def __init__(self, subdir, lineno, colno, condition, trueblock, falseblock):
self.subdir = subdir
self.lineno = lineno
self.colno = colno
self.condition = condition
Expand Down Expand Up @@ -540,7 +541,7 @@ def e1(self):
self.expect('colon')
falseblock = self.e1()
self.in_ternary = False
return TernaryNode(left.lineno, left.colno, left, trueblock, falseblock)
return TernaryNode(left.subdir, left.lineno, left.colno, left, trueblock, falseblock)
return left

def e2(self):
Expand Down

0 comments on commit cfbba18

Please sign in to comment.