Changeset 238577 in webkit
- Timestamp:
- Nov 27, 2018 2:12:53 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r238574 r238577 1 2018-11-27 Keith Rollin <krollin@apple.com> 2 3 Better parsing of comments in generate-message*.py 4 https://bugs.webkit.org/show_bug.cgi?id=191866 5 <rdar://problem/46189563> 6 7 Reviewed by Chris Dumez. 8 9 The script parsing the *.messages.in files would treat a line starting 10 with '#' as a comment, but not a line starting with '<whitespace>#'. 11 This means that jamming a '#' right in front of the first character of 12 a message definition (as opposed to the beginning of a line) will have 13 no effect and the line will get treated just the same as a 14 non-commented line. Fix this by trimming all white space from the 15 beginning and ending of the line before processing it. 16 17 * Scripts/webkit/parser.py: 18 (parse): 19 * Scripts/webkit/test-messages.in: 20 1 21 2018-11-27 Thibault Saunier <tsaunier@igalia.com> 2 22 -
trunk/Source/WebKit/Scripts/webkit/parser.py
r237110 r238577 51 51 superclass = [] 52 52 for line in file: 53 line = line.strip() 53 54 match = re.search(r'messages -> (?P<destination>[A-Za-z_0-9]+) \s*(?::\s*(?P<superclass>.*?) \s*)?(?:(?P<attributes>.*?)\s+)?{', line) 54 55 if match: … … 62 63 continue 63 64 if line.startswith('#'): 64 trimmed = line.rstrip()65 65 if line.startswith('#if '): 66 conditions.append( trimmed[4:])66 conditions.append(line[4:]) 67 67 elif line.startswith('#endif') and conditions: 68 68 conditions.pop() 69 69 elif line.startswith('#else') or line.startswith('#elif'): 70 raise Exception("ERROR: '%s' is not supported in the *.in files" % trimmed)70 raise Exception("ERROR: '%s' is not supported in the *.in files" % line) 71 71 continue 72 72 match = re.search(r'([A-Za-z_0-9]+)\((.*?)\)(?:(?:\s+->\s+)\((.*?)\))?(?:\s+(.*))?', line) -
trunk/Source/WebKit/Scripts/webkit/test-messages.in
r164171 r238577 23 23 #if ENABLE(WEBKIT2) 24 24 #if NESTED_MASTER_CONDITION || MASTER_OR && MASTER_AND 25 26 27 # The parser should treat all of these as comments 28 #FakeLoadURLA(String url) 29 # FakeLoadURLB(String url) 30 #FakeLoadURLC(String url) 31 # FakeLoadURLD(String url) 25 32 26 33 messages -> WebPage {
Note: See TracChangeset
for help on using the changeset viewer.