lang: Add support for raw catalog references with _R

_R marks a raw catalog entry as Referenced (= used) for cases where the
catalog pointers are handled at a lower level.
This commit is contained in:
Yuri D'Elia 2022-08-09 17:57:47 +02:00 committed by DRracer
parent 05093fbf49
commit 7a80252556
2 changed files with 3 additions and 2 deletions

View file

@ -46,6 +46,7 @@
#define _N(s) (__extension__({static const char __c[] PROGMEM_N1 = s; &__c[0];}))
#define _n(s) _N(s) // declare and return untranslated string
#define _R(s) (s) // return reference to translatable string (for warning suppression)
/** @brief lang_table_header_t structure - (size= 16byte) */
typedef struct

View file

@ -149,8 +149,8 @@ def extract_refs(path, catalog):
# match message catalog references to add backrefs
RE_CAT = r'''
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
\b (?:_[TO]) \s* \( \s* (\w+) \s* \) # $1 catalog name
(?<!(?:/[/*]|^\s*\#) [^\n]*) # not on a comment or preprocessor
\b (?:_[TOR]) \s* \( \s* (\w+) \s* \) # $1 catalog name
'''
for m in regex.finditer(RE_CAT, source, regex.M|regex.X):