mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1573080 - Supporting indenting of directives in preprocessor.py. r=glandium
Depends on D41494 Differential Revision: https://phabricator.services.mozilla.com/D41495 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
4e52c0f072
commit
13a7295574
@ -373,7 +373,7 @@ class Preprocessor:
|
||||
"""
|
||||
self.marker = aMarker
|
||||
if aMarker:
|
||||
self.instruction = re.compile('{0}(?P<cmd>[a-z]+)(?:\s+(?P<args>.*?))?\s*$'
|
||||
self.instruction = re.compile('\s*{0}(?P<cmd>[a-z]+)(?:\s+(?P<args>.*?))?\s*$'
|
||||
.format(aMarker))
|
||||
self.comment = re.compile(aMarker, re.U)
|
||||
else:
|
||||
|
@ -179,6 +179,16 @@ class TestPreprocessor(unittest.TestCase):
|
||||
'#endif',
|
||||
])
|
||||
|
||||
def test_indentation(self):
|
||||
self.do_include_pass([
|
||||
' #define NULLVAL 0',
|
||||
' #if !NULLVAL',
|
||||
'PASS',
|
||||
' #else',
|
||||
'FAIL',
|
||||
' #endif',
|
||||
])
|
||||
|
||||
def test_expand(self):
|
||||
self.do_include_pass([
|
||||
'#define ASVAR AS',
|
||||
|
Loading…
Reference in New Issue
Block a user