stm32/make-stmconst.py: Allow "[]" chars when parsing source comments.

For STM32WB MCUs, EXTI offset addresses were not parsed due to the
appearance of "[31:0]" in a comment in the .h file.
This commit is contained in:
Herwin Grobben 2021-03-05 10:05:19 +01:00 committed by Damien George
parent 59a129f22f
commit 35c602d3b8

View File

@ -46,7 +46,7 @@ class LexerError(Exception):
class Lexer: class Lexer:
re_io_reg = r"__IO uint(?P<bits>8|16|32)_t +(?P<reg>[A-Z0-9]+)" re_io_reg = r"__IO uint(?P<bits>8|16|32)_t +(?P<reg>[A-Z0-9]+)"
re_comment = r"(?P<comment>[A-Za-z0-9 \-/_()&:]+)" re_comment = r"(?P<comment>[A-Za-z0-9 \-/_()&:\[\]]+)"
re_addr_offset = r"Address offset: (?P<offset>0x[0-9A-Z]{2,3})" re_addr_offset = r"Address offset: (?P<offset>0x[0-9A-Z]{2,3})"
regexs = ( regexs = (
( (