stm32/make-stmconst.py: Improve regex to parse more constants.

A few RTC constants weren't being parsed properly due to whitespace
differences, and this patch makes certain whitespace optional.  Changes
made:

- allow for no space between /*!< and EXTI, eg for:
  __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */

- allow for no space between semicolon and start of comment, eg for:
  __IO uint32_t ALRMASSR;/*!< RTC alarm A sub second register, Address offset: 0x44 */
pull/4530/head
Dave Hylands 2019-02-14 11:56:02 -08:00 zatwierdzone przez Damien George
rodzic 9441f4b682
commit 92fec603d0
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -48,8 +48,8 @@ class Lexer:
('{', re.compile(r'{$')),
('}', re.compile(r'}$')),
('} TypeDef', re.compile(r'} *(?P<id>[A-Z][A-Za-z0-9_]+)_(?P<global>([A-Za-z0-9_]+)?)TypeDef;$')),
('IO reg', re.compile(re_io_reg + r'; +/\*!< ' + re_comment + r', +' + re_addr_offset + r' *\*/')),
('IO reg array', re.compile(re_io_reg + r'\[(?P<array>[2-8])\]; +/\*!< ' + re_comment + r', +' + re_addr_offset + r'-(0x[0-9A-Z]{2,3}) *\*/')),
('IO reg', re.compile(re_io_reg + r'; */\*!< *' + re_comment + r', +' + re_addr_offset + r' *\*/')),
('IO reg array', re.compile(re_io_reg + r'\[(?P<array>[2-8])\]; */\*!< *' + re_comment + r', +' + re_addr_offset + r'-(0x[0-9A-Z]{2,3}) *\*/')),
)
def __init__(self, filename):