135 if (
string[0] !=
'@') {
176 #define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_fn) \
179 for (; txtfmt_py_numeral_char_is_fn(*string); string += 1) { \
189 return ELEM(
c,
'0',
'1') || (
c ==
'_');
199 return (
c >=
'0' &&
c <=
'7') || (
c ==
'_');
209 return (
c >=
'0' &&
c <=
'9') || (
c ==
'_');
219 return (
c >=
'0' &&
c <=
'9') || (
c >=
'a' &&
c <=
'f') || (
c >=
'A' &&
c <=
'F') || (
c ==
'_');
229 return (
ELEM(
c,
'0',
'_'));
236 #undef TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL
240 if (
string ==
NULL || *
string ==
'\0') {
244 const char first = *string, second = *(
string + 1);
254 else if (first ==
'0') {
256 if (
ELEM(second,
'x',
'X')) {
260 if (
ELEM(second,
'o',
'O')) {
264 if (
ELEM(second,
'b',
'B')) {
268 if (
ELEM(second,
'0',
'_')) {
273 else if (first >
'0' && first <=
'9') {
277 return (first ==
'0') ? 1 : 0;
282 if (
string ==
NULL || *
string ==
'\0') {
286 const char first = *string, second = *(
string + 1);
335 char cont_orig, cont, find,
prev =
' ';
341 cont = fmt[strlen(fmt) + 1];
351 cont_orig = fmt[strlen(fmt) + 1];
385 if (*
str == find && *(
str + 1) == find && *(
str + 2) == find) {
413 else if (
ELEM(*
str,
'"',
'\'')) {
417 if (*(
str + 1) == find && *(
str + 2) == find) {
429 else if (*
str ==
' ') {
495 if (cont != cont_orig && do_next && line->
next) {
505 static const char *ext[] = {
"py",
NULL};
bool text_check_digit(char ch)
bool text_check_identifier(char ch)
bool text_check_delim(char ch)
bool text_check_whitespace(char ch)
int BLI_str_utf8_size_safe(const char *p) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
SymEdge< T > * prev(const SymEdge< T > *se)
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
char(* format_identifier)(const char *string)
void(* format_line)(SpaceText *st, TextLine *line, bool do_next)
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)