⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 160161 in webkit


Ignore:
Timestamp:
Dec 4, 2013, 11:41:26 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Report error when #else is used in message receiver generator's input.
https://bugs.webkit.org/show_bug.cgi?id=124147

Patch by Gergo Balogh <geryxyz@inf.u-szeged.hu> on 2013-12-04
Reviewed by Csaba Osztrogonác.

  • Scripts/webkit2/messages_unittest.py:

(UnsupportedPrecompilerDirectiveTest):
(UnsupportedPrecompilerDirectiveTest.test_error_at_else):
(UnsupportedPrecompilerDirectiveTest.test_error_at_elif):

  • Scripts/webkit2/parser.py:

(parse):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r160148 r160161  
     12013-12-04  Gergo Balogh  <geryxyz@inf.u-szeged.hu>
     2
     3        Report error when #else is used in message receiver generator's input.
     4        https://bugs.webkit.org/show_bug.cgi?id=124147
     5
     6        Reviewed by Csaba Osztrogonác.
     7
     8        * Scripts/webkit2/messages_unittest.py:
     9        (UnsupportedPrecompilerDirectiveTest):
     10        (UnsupportedPrecompilerDirectiveTest.test_error_at_else):
     11        (UnsupportedPrecompilerDirectiveTest.test_error_at_elif):
     12        * Scripts/webkit2/parser.py:
     13        (parse):
     14
    1152013-12-04  Sam Weinig  <sam@webkit.org>
    216
  • trunk/Source/WebKit2/Scripts/webkit2/messages_unittest.py

    r160022 r160161  
    11271127
    11281128
     1129class UnsupportedPrecompilerDirectiveTest(unittest.TestCase):
     1130    def test_error_at_else(self):
     1131        with self.assertRaisesRegexp(Exception, r"ERROR: '#else.*' is not supported in the \*\.in files"):
     1132            messages.generate_message_handler(StringIO("asd\n#else bla\nfoo"))
     1133
     1134    def test_error_at_elif(self):
     1135        with self.assertRaisesRegexp(Exception, r"ERROR: '#elif.*' is not supported in the \*\.in files"):
     1136            messages.generate_message_handler(StringIO("asd\n#elif bla\nfoo"))
     1137
     1138
    11291139if __name__ == '__main__':
    11301140    unittest.main()
  • trunk/Source/WebKit2/Scripts/webkit2/parser.py

    r159312 r160161  
    6060            continue
    6161        if line.startswith('#'):
     62            trimmed = line.rstrip()
    6263            if line.startswith('#if '):
    63                 conditions.append(line.rstrip()[4:])
     64                conditions.append(trimmed[4:])
    6465            elif line.startswith('#endif') and conditions:
    6566                conditions.pop()
     67            elif line.startswith('#else') or line.startswith('#elif'):
     68                raise Exception("ERROR: '%s' is not supported in the *.in files" % trimmed)
    6669            continue
    6770        match = re.search(r'([A-Za-z_0-9]+)\((.*?)\)(?:(?:\s+->\s+)\((.*?)\))?(?:\s+(.*))?', line)
Note: See TracChangeset for help on using the changeset viewer.