Skip to content

Commit be56235

Browse files
committed
implement easy solution
1 parent 4116bae commit be56235

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clang/docs/tools/dump_ast_matchers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import collections
77
import re
88
import os
9+
import sys
910

1011
try:
1112
from urllib.request import urlopen
@@ -615,5 +616,7 @@ def sort_table(matcher_type, matcher_map):
615616
flags=re.S,
616617
)
617618

618-
with open(HTML_FILE, "w", newline="\n") as output:
619+
output_file = sys.argv[1] if len(sys.argv) == 2 else HTML_FILE
620+
621+
with open(output_file, "w", newline="\n") as output:
619622
output.write(reference)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: %python %S/../../docs/tools/dump_ast_matchers.py %t
2+
// RUN: diff %t %S/../../docs/LibASTMatchersReference.html

0 commit comments

Comments
 (0)