diff options
author | Michele Calgaro <[email protected]> | 2022-05-06 13:43:02 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2022-05-06 13:49:57 +0900 |
commit | 80a31d6c8a114799dc5284086ffce2e9be34c50e (patch) | |
tree | 1719891657e76c04f063f5ff7b5fdf63d9e562c3 /debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h | |
parent | e6ba08c3b21cdb14ee3a97b5d584759a4597b54b (diff) | |
download | extra-dependencies-80a31d6c8a114799dc5284086ffce2e9be34c50e.tar.gz extra-dependencies-80a31d6c8a114799dc5284086ffce2e9be34c50e.zip |
uncrustify-trinity: updated based on upstream version 0.75.0
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h')
-rw-r--r-- | debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h new file mode 100644 index 00000000..ed4c3fa5 --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.75.0/src/punctuators.h @@ -0,0 +1,52 @@ +/** + * @file punctuators.h + */ + +#ifndef PUNCTUATORS_H_INCLUDED +#define PUNCTUATORS_H_INCLUDED + +#include "uncrustify_types.h" + + +struct lookup_entry_t +{ + char ch; + char left_in_group; + UINT16 next_idx; + const chunk_tag_t *tag; + + struct comperator + { + static char get_char(const lookup_entry_t &v) + { + return(v.ch); + } + + + static char get_char(char t) + { + return(t); + } + + template<typename T1, typename T2> + bool operator()(T1 const &t1, T2 const &t2) + { + return(get_char(t1) < get_char(t2)); + } + }; +}; + + +/** + * Checks if the first max. 6 chars of a given string match a punctuator + * + * @param str string that will be checked, can be shorter than 6 chars + * @param lang_flags specifies from which language punctuators will be considered + * + * @retval chunk tag of the found punctuator + * @retval nullptr if nothing found + */ +const chunk_tag_t *find_punctuator(const char *str, int lang_flags); + + +#endif /* PUNCTUATORS_H_INCLUDED */ |