Remove some boilerplate
[litex.git] / cmacros.py
1 import re
2
3 def get_macros(filename):
4 f = open(filename, "r")
5 r = {}
6 for line in f:
7 match = re.match("\w*#define\s+(\w+)\s+(.*)", line, re.IGNORECASE)
8 if match:
9 r[match.group(1)] = match.group(2)
10 return r