133 if (
string[0] !=
'@') {
174 #define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_fn) \
177 for (; txtfmt_py_numeral_char_is_fn(*string); string += 1) { \
187 return ELEM(
c,
'0',
'1') || (
c ==
'_');
197 return (
c >=
'0' &&
c <=
'7') || (
c ==
'_');
207 return (
c >=
'0' &&
c <=
'9') || (
c ==
'_');
217 return (
c >=
'0' &&
c <=
'9') || (
c >=
'a' &&
c <=
'f') || (
c >=
'A' &&
c <=
'F') || (
c ==
'_');
227 return (
ELEM(
c,
'0',
'_'));
234 #undef TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL
238 if (
string ==
NULL || *
string ==
'\0') {
242 const char first = *string, second = *(
string + 1);
252 else if (first ==
'0') {
254 if (
ELEM(second,
'x',
'X')) {
258 if (
ELEM(second,
'o',
'O')) {
262 if (
ELEM(second,
'b',
'B')) {
266 if (
ELEM(second,
'0',
'_')) {
271 else if (first >
'0' && first <=
'9') {
275 return (first ==
'0') ? 1 : 0;
280 if (
string ==
NULL || *
string ==
'\0') {
284 const char first = *string, second = *(
string + 1);
333 char cont_orig, cont, find, prev =
' ';
339 cont = fmt[strlen(fmt) + 1];
349 cont_orig = fmt[strlen(fmt) + 1];
383 if (*
str == find && *(
str + 1) == find && *(
str + 2) == find) {
411 else if (
ELEM(*
str,
'"',
'\'')) {
415 if (*(
str + 1) == find && *(
str + 2) == find) {
427 else if (*
str ==
' ') {
492 if (cont != cont_orig && do_next && line->
next) {
502 static const char *ext[] = {
"py",
NULL};
bool text_check_identifier(const char ch)
bool text_check_digit(const char ch)
bool text_check_delim(const char ch)
bool text_check_whitespace(const char ch)
int BLI_str_utf8_size_safe(const char *p) ATTR_NONNULL()
void(* format_line)(SpaceText *st, TextLine *line, const bool do_next)
char(* format_identifier)(const char *string)
int flatten_string(const SpaceText *st, FlattenString *fs, const char *in)
void text_format_fill(const char **str_p, char **fmt_p, const char type, const int len)
void flatten_string_free(FlattenString *fs)
void text_format_fill_ascii(const char **str_p, char **fmt_p, const char type, const int len)
void ED_text_format_register(TextFormatType *tft)
int text_check_format_len(TextLine *line, uint len)
#define STR_LITERAL_STARTSWITH(str, str_literal, len_var)
static bool txtfmt_py_numeral_char_is_hexadecimal(const char c)
static int txtfmt_py_find_numeral_inner(const char *string)
static uint txtfmt_py_numeral_string_count_hexadecimal(const char *string)
static uint txtfmt_py_numeral_string_count_octal(const char *string)
void ED_text_format_register_py(void)
static bool txtfmt_py_numeral_char_is_decimal(const char c)
#define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_fn)
static char txtfmt_py_format_identifier(const char *str)
static int txtfmt_py_find_specialvar(const char *string)
static int txtfmt_py_find_bool(const char *string)
static int txtfmt_py_find_decorator(const char *string)
static bool txtfmt_py_numeral_char_is_binary(const char c)
static int txtfmt_py_literal_numeral(const char *string, char prev_fmt)
static bool txtfmt_py_numeral_char_is_zero(const char c)
static uint txtfmt_py_numeral_string_count_zeros(const char *string)
static uint txtfmt_py_numeral_string_count_binary(const char *string)
static int txtfmt_py_find_builtinfunc(const char *string)
static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const bool do_next)
static uint txtfmt_py_numeral_string_count_decimal(const char *string)
static bool txtfmt_py_numeral_char_is_octal(const char c)