MCPcopy Create free account
hub / github.com/argotorg/solidity / find_ids_in_source_file

Function find_ids_in_source_file

scripts/error_codes.py:41–51  ·  view source on GitHub ↗
(file_name, id_to_file_names)

Source from the content-addressed store, hash-verified

39
40
41def find_ids_in_source_file(file_name, id_to_file_names):
42 source = read_file(file_name)
43 for m in re.finditer(SOURCE_FILE_PATTERN, source):
44 if in_comment(source, m.start()):
45 continue
46 underscore_pos = m.group(0).index("_")
47 error_id = m.group(0)[0:underscore_pos]
48 if error_id in id_to_file_names:
49 id_to_file_names[error_id].append(file_name)
50 else:
51 id_to_file_names[error_id] = [file_name]
52
53
54def find_ids_in_source_files(file_names):

Callers 1

find_ids_in_source_filesFunction · 0.85

Calls 5

read_fileFunction · 0.85
in_commentFunction · 0.85
startMethod · 0.80
indexMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected