Skip to content

Commit 48ef926

Browse files
author
Kostiantyn Sologubov
committed
Revert "removed caseless keyword matching"
1 parent ab1c57a commit 48ef926

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

generator/generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def get_key_words(self, file_name=ROOT.joinpath('rpc_spec/RpcParser/RESERVED_KEY
262262
:return:
263263
"""
264264
content = self.get_file_content(file_name)
265-
content = tuple(map(lambda e: re.sub(r'\n', r'', e).strip(), content))
265+
content = tuple(map(lambda e: re.sub(r'\n', r'', e).strip().casefold(), content))
266266
try:
267267
content = tuple(filter(lambda e: not re.search(r'^#+\s+.+|^$', e), content))
268268
self.logger.debug('key_words: %s', ', '.join(content))

generator/transformers/common_producer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def replace_keywords(self, name: str = '') -> str:
9191
if :param name in self.key_words, :return: name += 'Param'
9292
:param name: string with item name
9393
"""
94-
if any(map(lambda k: re.search(r'^(get|set|key_)?{}$'.format(name), k), self.key_words)):
94+
if any(map(lambda k: re.search(r'^(get|set|key_)?{}$'.format(name.casefold()), k), self.key_words)):
9595
origin = name
9696
if name.isupper():
9797
name += '_PARAM'

0 commit comments

Comments
 (0)