From 50eac80f6244e398f044e0141d9d982da5c4bc46 Mon Sep 17 00:00:00 2001 From: Javier Arroyo Date: Tue, 21 Apr 2020 13:53:58 +0200 Subject: [PATCH] Modify names of IO blocks instantiated as arrays --- parsing/parser.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/parsing/parser.py b/parsing/parser.py index 6afb9053d..cc6b0fbb3 100644 --- a/parsing/parser.py +++ b/parsing/parser.py @@ -248,6 +248,11 @@ def _make_var_name(block, style, description='', attribute=''): # General modification name = block.replace('.', '_') + # Go through name to identify potential array indices + index = None + if '[' and ']' in name: + index = name[name.find('[')+1:name.find(']')] + name = name.replace('['+index+']','_index{}'.format(index)) # Handle empty descriptions if description is '': description = ''