diff options
author | Chris Johns <chrisj@rtems.org> | 2016-03-18 10:45:28 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2016-03-18 10:45:28 +1100 |
commit | 8bde72706504c5df945f2bb08d9805f9e8526e69 (patch) | |
tree | 827af0e43e681dc77bd3d3c1b517cc33f6dc0cf1 | |
parent | 52cb466a6d674a2d1476f7a3672787205f324f64 (diff) |
sb: Fix %if logical OP parsing.
Updates #2655.
-rw-r--r-- | source-builder/sb/config.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 732239f..4c26714 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -781,20 +781,26 @@ class file: elif cls[0] == '&&': join_op = 'and' cls = cls[1:] + log.trace('config: %s: _if: joining: %s' % (self.name, join_op)) ori = 0 andi = 0 i = len(cls) if '||' in cls: ori = cls.index('||') + log.trace('config: %s: _if: OR found at %i' % (self.name, ori)) if '&&' in cls: andi = cls.index('&&') + log.trace('config: %s: _if: AND found at %i' % (self.name, andi)) if ori > 0 or andi > 0: - if ori < andi: + if ori == 0: + i = andii + elif andi == 0: i = ori - else: + elif ori < andi: i = andi - if ori == 0: + else: i = andi + log.trace('config: %s: _if: next OP found at %i' % (self.name, i)) ls = cls[:i] if len(ls) == 0: self._error('invalid if expression: ' + reduce(add, sls, '')) |