summaryrefslogtreecommitdiff
path: root/pygments/lexers/_cocoa_builtins.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/_cocoa_builtins.py')
-rw-r--r--pygments/lexers/_cocoa_builtins.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/pygments/lexers/_cocoa_builtins.py b/pygments/lexers/_cocoa_builtins.py
index 064167ff..f17ea876 100644
--- a/pygments/lexers/_cocoa_builtins.py
+++ b/pygments/lexers/_cocoa_builtins.py
@@ -40,24 +40,25 @@ if __name__ == '__main__': # pragma: no cover
continue
headerFilePath = frameworkHeadersDir + f
- content = open(headerFilePath).read()
- res = re.findall('(?<=@interface )\w+', content)
+ with open(headerFilePath) as f:
+ content = f.read()
+ res = re.findall(r'(?<=@interface )\w+', content)
for r in res:
all_interfaces.add(r)
- res = re.findall('(?<=@protocol )\w+', content)
+ res = re.findall(r'(?<=@protocol )\w+', content)
for r in res:
all_protocols.add(r)
- res = re.findall('(?<=typedef enum )\w+', content)
+ res = re.findall(r'(?<=typedef enum )\w+', content)
for r in res:
all_primitives.add(r)
- res = re.findall('(?<=typedef struct )\w+', content)
+ res = re.findall(r'(?<=typedef struct )\w+', content)
for r in res:
all_primitives.add(r)
- res = re.findall('(?<=typedef const struct )\w+', content)
+ res = re.findall(r'(?<=typedef const struct )\w+', content)
for r in res:
all_primitives.add(r)