Blender  V2.93
Macros | Functions
text_format_py.c File Reference
#include <string.h>
#include "BLI_blenlib.h"
#include "DNA_space_types.h"
#include "DNA_text_types.h"
#include "BKE_text.h"
#include "text_format.h"

Go to the source code of this file.

Macros

#define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL(txtfmt_py_numeral_char_is_fn)
 

Functions

static int txtfmt_py_find_builtinfunc (const char *string)
 
static int txtfmt_py_find_specialvar (const char *string)
 
static int txtfmt_py_find_decorator (const char *string)
 
static int txtfmt_py_find_bool (const char *string)
 
static bool txtfmt_py_numeral_char_is_binary (const char c)
 
static uint txtfmt_py_numeral_string_count_binary (const char *string)
 
static bool txtfmt_py_numeral_char_is_octal (const char c)
 
static uint txtfmt_py_numeral_string_count_octal (const char *string)
 
static bool txtfmt_py_numeral_char_is_decimal (const char c)
 
static uint txtfmt_py_numeral_string_count_decimal (const char *string)
 
static bool txtfmt_py_numeral_char_is_hexadecimal (const char c)
 
static uint txtfmt_py_numeral_string_count_hexadecimal (const char *string)
 
static bool txtfmt_py_numeral_char_is_zero (const char c)
 
static uint txtfmt_py_numeral_string_count_zeros (const char *string)
 
static int txtfmt_py_find_numeral_inner (const char *string)
 
static int txtfmt_py_literal_numeral (const char *string, char prev_fmt)
 
static char txtfmt_py_format_identifier (const char *str)
 
static void txtfmt_py_format_line (SpaceText *st, TextLine *line, const bool do_next)
 
void ED_text_format_register_py (void)
 

Macro Definition Documentation

◆ TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL

#define TXTFMT_PY_NUMERAL_STRING_COUNT_IMPL (   txtfmt_py_numeral_char_is_fn)
Value:
{ \
uint count = 0; \
for (; txtfmt_py_numeral_char_is_fn(*string); string += 1) { \
count += 1; \
} \
return count; \
} \
((void)0)
int count

Definition at line 174 of file text_format_py.c.

Function Documentation

◆ ED_text_format_register_py()

void ED_text_format_register_py ( void  )

◆ txtfmt_py_find_bool()

static int txtfmt_py_find_bool ( const char *  string)
static

Definition at line 151 of file text_format_py.c.

References len, STR_LITERAL_STARTSWITH, and text_check_identifier().

Referenced by txtfmt_py_format_line().

◆ txtfmt_py_find_builtinfunc()

static int txtfmt_py_find_builtinfunc ( const char *  string)
static

Checks the specified source string for a Python built-in function name. This name must start at the beginning of the source string and must be followed by a non-identifier (see text_check_identifier(char)) or null character.

If a built-in function is found, the length of the matching name is returned. Otherwise, -1 is returned.

See: http://docs.python.org/py3k/reference/lexical_analysis.html#keywords

Definition at line 44 of file text_format_py.c.

References len, STR_LITERAL_STARTSWITH, and text_check_identifier().

Referenced by txtfmt_py_format_identifier(), and txtfmt_py_format_line().

◆ txtfmt_py_find_decorator()

static int txtfmt_py_find_decorator ( const char *  string)
static

◆ txtfmt_py_find_numeral_inner()

static int txtfmt_py_find_numeral_inner ( const char *  string)
static

◆ txtfmt_py_find_specialvar()

static int txtfmt_py_find_specialvar ( const char *  string)
static

◆ txtfmt_py_format_identifier()

static char txtfmt_py_format_identifier ( const char *  str)
static

◆ txtfmt_py_format_line()

static void txtfmt_py_format_line ( SpaceText st,
TextLine line,
const bool  do_next 
)
static

◆ txtfmt_py_literal_numeral()

static int txtfmt_py_literal_numeral ( const char *  string,
char  prev_fmt 
)
static

◆ txtfmt_py_numeral_char_is_binary()

static bool txtfmt_py_numeral_char_is_binary ( const char  c)
static

Definition at line 185 of file text_format_py.c.

References Freestyle::c, and ELEM.

Referenced by txtfmt_py_numeral_string_count_binary().

◆ txtfmt_py_numeral_char_is_decimal()

static bool txtfmt_py_numeral_char_is_decimal ( const char  c)
static

Definition at line 205 of file text_format_py.c.

References Freestyle::c.

Referenced by txtfmt_py_numeral_string_count_decimal().

◆ txtfmt_py_numeral_char_is_hexadecimal()

static bool txtfmt_py_numeral_char_is_hexadecimal ( const char  c)
static

Definition at line 215 of file text_format_py.c.

References Freestyle::c.

Referenced by txtfmt_py_numeral_string_count_hexadecimal().

◆ txtfmt_py_numeral_char_is_octal()

static bool txtfmt_py_numeral_char_is_octal ( const char  c)
static

Definition at line 195 of file text_format_py.c.

References Freestyle::c.

Referenced by txtfmt_py_numeral_string_count_octal().

◆ txtfmt_py_numeral_char_is_zero()

static bool txtfmt_py_numeral_char_is_zero ( const char  c)
static

Definition at line 225 of file text_format_py.c.

References Freestyle::c, and ELEM.

Referenced by txtfmt_py_numeral_string_count_zeros().

◆ txtfmt_py_numeral_string_count_binary()

static uint txtfmt_py_numeral_string_count_binary ( const char *  string)
static

◆ txtfmt_py_numeral_string_count_decimal()

static uint txtfmt_py_numeral_string_count_decimal ( const char *  string)
static

◆ txtfmt_py_numeral_string_count_hexadecimal()

static uint txtfmt_py_numeral_string_count_hexadecimal ( const char *  string)
static

◆ txtfmt_py_numeral_string_count_octal()

static uint txtfmt_py_numeral_string_count_octal ( const char *  string)
static

◆ txtfmt_py_numeral_string_count_zeros()

static uint txtfmt_py_numeral_string_count_zeros ( const char *  string)
static