Skip to content

Commit

Permalink
Fix issues parsing clang output (see #3836)
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenblatt committed Jan 14, 2025
1 parent 719f423 commit 70c6a04
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
50 changes: 25 additions & 25 deletions cef_api_versions.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
{
"hashes": {
"13300": {
"comment": "Added January 09, 2025.",
"linux": "e1587dc51f661b5b04e62d6bf0bd843fa5eac11a",
"mac": "17d3b6eb33f5ed22cdacef535964126791059610",
"universal": "ff64648f9227db22b066b00af9e47e18b96b30ae",
"windows": "3c76176c289ff30bb52096d429ded4377edd9a0f"
"comment": "Added January 13, 2025.",
"linux": "b622b5e8d42567bd96b6c530c3bf39b42d94c97a",
"mac": "10daecda70220382f54f8b1fc3b2d1df7da3088c",
"universal": "a5c9449c676e3d151ac2d141bd3907dcd1fec3d4",
"windows": "854c5a8fc37bb040ad0ad8e4680f62b07ec217c0"
},
"13301": {
"comment": "Added January 09, 2025.",
"linux": "180a9e77de7dad07c7352610f3f363144c45280e",
"mac": "a86b5dcffa3b9e4757ef16b20d91f6d0daa2e403",
"universal": "13935bdd9681f992dccff2e55d518b20baa3a239",
"windows": "db5f66a241482203f533eb267f4f5224408d277c"
"comment": "Added January 13, 2025.",
"linux": "0ec77d8bc98964aaf2c4ac037dbbe47f59863902",
"mac": "65b51b1dfde1ab0af99d98e1e8b6aadf5bc28707",
"universal": "e343550e4371b76f59813dac2742a9d3206cb98f",
"windows": "34b14819172ed39721a3fe298cf73dec7b6e7df2"
},
"13302": {
"comment": "Added January 09, 2025.",
"linux": "580ba12aeafc536cfbf9251110ff1f3e15d87aac",
"mac": "54a20f4ac36bd15ad10218f0068d18af3d04efe8",
"universal": "a3b248f23d3af14fd24851cbeb28697fef046f2c",
"windows": "fcf4556bf50e6d4cd59377271321cee6522fd3c2"
"comment": "Added January 13, 2025.",
"linux": "e98affe8187daaa1ee02b01677208ff0a54af74c",
"mac": "45a0649980f85c53a6156627f0af6368ccfc5554",
"universal": "b8423655541f6f2a1a9b6f5252f03e59842dc31a",
"windows": "b04c40f0d79e2ea6f6a4d508843b9eaafb102c1e"
},
"13303": {
"comment": "Added January 09, 2025.",
"linux": "24d10153ac286784204ea35c640e53d4bc937095",
"mac": "e4e2be4902e6c8bbeb53d53459be2aa2b4f8e940",
"universal": "b24a4ce14563c5863ed6bc43dcaf589ec78756a9",
"windows": "036217a6a9474322be0833079258c0375238c65c"
"comment": "Added January 13, 2025.",
"linux": "1b2584e9f06dc0cb59ccceee89857fc164d4db52",
"mac": "82d74e5024ed80b43d49d7e83b0e8a3a42a0b319",
"universal": "a0905ba86f2c4964857f6c9c0706ab3e1050a8cd",
"windows": "bc115a66808672931cf676ce31d58ded946f680e"
},
"13304": {
"comment": "Added January 09, 2025.",
"linux": "8a0265bdf5375d9506cd6178265d8d77e02c9211",
"mac": "ba00fa76a7a14e529a1f157cefc74a9e81fb9fc8",
"universal": "c01bd6cb26be588948b0c16dde26324461b9e0b6",
"windows": "fb0eb5ac0461ea2d549808450017e87aeca74b94"
"comment": "Added January 13, 2025.",
"linux": "199fe896c737a07dcf1506e0c86688363df7e8b6",
"mac": "405810f1f8b146678867b6a91cbe8c4670febbbf",
"universal": "be55f7cf1813ae098d4f68b2a2c9ca85784fc3ee",
"windows": "73bb28a92f4be742e3fc80057a80797e3bf23063"
}
},
"last": "13304",
Expand Down
9 changes: 7 additions & 2 deletions tools/cef_api_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def calculate(self, api_version, debug_dir=None, added_defines=None):
if debug_enabled:
self.__write_debug_file(
debug_dir, 'clang-' + filename.replace('/', '-'), content)
content_objects = self.__parse_objects(content)

# content must always start with newline as required by __parse_objects()
content_objects = self.__parse_objects('\n' + content)
self.__prepare_objects(filename, content_objects)
else:
content_objects = self.filecontentobjs.get(filename, None)
Expand Down Expand Up @@ -226,7 +228,10 @@ def __parse_objects(self, content):
r"\ntypedef\s+?struct\s+?(\w+)\s+?\{.*?\}\s+?(\w+)\s*?;",
content,
flags=re.DOTALL):
object = {"name": m.group(2), "text": m.group(0).strip()}
text = m.group(0).strip()
# remove 'CEF_CALLBACK' to normalize cross-platform clang output
text = text.replace('CEF_CALLBACK', '')
object = {"name": m.group(2), "text": text}
objects.append(object)

# enums
Expand Down

0 comments on commit 70c6a04

Please # to comment.