This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1e62587a48a3: [clang][docs] Defensively turn off exception 
behavior in dump_ast_matchers.py (authored by t-rasmud).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155134/new/

https://reviews.llvm.org/D155134

Files:
  clang/docs/tools/dump_ast_matchers.py


Index: clang/docs/tools/dump_ast_matchers.py
===================================================================
--- clang/docs/tools/dump_ast_matchers.py
+++ clang/docs/tools/dump_ast_matchers.py
@@ -15,7 +15,8 @@
 try:
     CLASS_INDEX_PAGE = urlopen(CLASS_INDEX_PAGE_URL).read().decode("utf-8")
 except Exception as e:
-    raise Exception("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
+    CLASS_INDEX_PAGE = None
+    print("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
 
 MATCHERS_FILE = "../../include/clang/ASTMatchers/ASTMatchers.h"
 
@@ -58,7 +59,10 @@
         url = "https://clang.llvm.org/doxygen/classclang_1_1%s.html"; % name
         if url not in doxygen_probes:
             search_str = 'href="classclang_1_1%s.html"' % name
-            doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            if CLASS_INDEX_PAGE is not None:
+                doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            else:
+                doxygen_probes[url] = True
             if not doxygen_probes[url]:
                 print("Did not find %s in class index page" % name)
         if doxygen_probes[url]:
@@ -186,7 +190,7 @@
     """
     if declaration.strip():
 
-        if re.match(r"^\s?(#|namespace|using)", declaration):
+        if re.match(r"^\s?(#|namespace|using|template <typename NodeType> 
using|})", declaration):
             return
 
         # Node matchers are defined by writing:


Index: clang/docs/tools/dump_ast_matchers.py
===================================================================
--- clang/docs/tools/dump_ast_matchers.py
+++ clang/docs/tools/dump_ast_matchers.py
@@ -15,7 +15,8 @@
 try:
     CLASS_INDEX_PAGE = urlopen(CLASS_INDEX_PAGE_URL).read().decode("utf-8")
 except Exception as e:
-    raise Exception("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
+    CLASS_INDEX_PAGE = None
+    print("Unable to get %s: %s" % (CLASS_INDEX_PAGE_URL, e))
 
 MATCHERS_FILE = "../../include/clang/ASTMatchers/ASTMatchers.h"
 
@@ -58,7 +59,10 @@
         url = "https://clang.llvm.org/doxygen/classclang_1_1%s.html"; % name
         if url not in doxygen_probes:
             search_str = 'href="classclang_1_1%s.html"' % name
-            doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            if CLASS_INDEX_PAGE is not None:
+                doxygen_probes[url] = search_str in CLASS_INDEX_PAGE
+            else:
+                doxygen_probes[url] = True
             if not doxygen_probes[url]:
                 print("Did not find %s in class index page" % name)
         if doxygen_probes[url]:
@@ -186,7 +190,7 @@
     """
     if declaration.strip():
 
-        if re.match(r"^\s?(#|namespace|using)", declaration):
+        if re.match(r"^\s?(#|namespace|using|template <typename NodeType> using|})", declaration):
             return
 
         # Node matchers are defined by writing:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to