mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
10 lines
215 B
Python
10 lines
215 B
Python
import re
|
|
|
|
def get_macros(filename):
|
|
f = open(filename, "r")
|
|
r = {}
|
|
for line in f:
|
|
match = re.match("\w*#define\s+(\w+)\s+(.*)", line, re.IGNORECASE)
|
|
if match:
|
|
r[match.group(1)] = match.group(2)
|
|
return r
|