Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _sub_symbols(self, line):
while re.search(r'::\w+::', line):
s = re.search(r'::\w+::', line).group(0)
if s in self.symbols:
line = line.replace(s, self.symbols[s])
else:
raise RuleFileError('Undefined symbol: {}'.format(s))
return line