Commit 13a72955 authored by Nicholas Nethercote's avatar Nicholas Nethercote
Browse files

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
parent 4e52c0f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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:
+10 −0
Original line number Diff line number Diff line
@@ -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',