Remillard / VHDL-Mode

A package for Sublime Text that aids coding in the VHDL language.
MIT License
39 stars 10 forks source link

Port copying error #21

Closed Remillard closed 7 years ago

Remillard commented 7 years ago

Parser threw the following error when copying this port (autogenerated from HDL Designer's State Machine tool from the legacy design)

ENTITY MRB_trigger IS
   PORT( 
      CE            : IN     std_logic;
      MRB           : IN     std_logic;
      clk_80        : IN     std_logic;
      tacan_mode    : IN     std_logic_vector (6 DOWNTO 0);
      MRB_P_trigger : OUT    std_logic;
      MRB_S_trigger : OUT    std_logic;
      MRB_window    : OUT    std_logic;
      NRT_trigger   : OUT    std_logic
   );

Error created:

vhdl-mode: Interface beginning found.
vhdl-mode: Interface end found.
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\vhdl_mode\vhdl_mode.py", line 150, in run
    _interface.parse_block()
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\vhdl_mode\vhdl_lang.py", line 997, in parse_block
    self.strip_head_tail()
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\vhdl_mode\vhdl_lang.py", line 935, in strip_head_tail
    self.if_string = self.if_string[hs.end():ts.start()]
AttributeError: 'NoneType' object has no attribute 'start'
Remillard commented 7 years ago

Found solution, may be a few days to get it implemented though. In class Interface, method strip_head_tail, change the tail_pattern to:

        tail_pattern = 'end\s?(?:{})?\s?(?:{})?\s?;'.format(self.type, self.name)

Seems to have been an error with counting spaces, and accounting for a space between the final word and the semicolon (which is a strange style, but since this was machine generated, it's not completely out of the realm).

Remillard commented 7 years ago

Fixing this in 1.1.2 today.