Skip to content

Commit

Permalink
better way to parse
Browse files Browse the repository at this point in the history
  • Loading branch information
Novecento99 committed Jul 17, 2024
1 parent 54969ed commit 99679b8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions snap7/util/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,7 @@ def parse_specification(db_specification: str) -> Dict[str, Any]:

for line in db_specification.split("\n"):
if line and not line.lstrip().startswith("#"):
parsed_text = line.lstrip().split("#")[0].split()

index = parsed_text[0]
_type = parsed_text[-1]
var_name_list = parsed_text[1:-1]
var_name = ''.join(var_name_list)
index, *var_name, _type = line.lstrip().split("#")[0].split()

parsed_db_specification[var_name] = (index, _type)

Expand Down

0 comments on commit 99679b8

Please sign in to comment.