From 9042af391b891b0b0b9d9a04d35ac98ea95ca11d Mon Sep 17 00:00:00 2001 From: dx Date: Wed, 20 May 2020 14:56:59 +0100 Subject: ~!refactor of the compile_inner_text function Set compiled token recipes in the compiler.h file (easier to manage) and let code handle the rest. --- Converter/includes/compiler.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Converter/includes') diff --git a/Converter/includes/compiler.h b/Converter/includes/compiler.h index 6e1eca8..1e8578f 100644 --- a/Converter/includes/compiler.h +++ b/Converter/includes/compiler.h @@ -6,6 +6,8 @@ typedef char *string; const static char TOKENS[] = {'*', '_', '~'}; +const static char *TOKENS_COMPILED[] = { "", "", "" }; +const static char *TOKENS_CLOSE_COMPILED[] = { "", "", "" }; const static size_t N_TOKENS = 3; /* Compile markdown line to HTML line */ @@ -14,5 +16,7 @@ string compile_line(string line, size_t sz_line, string line_or_source); int find_string(string src, string query, size_t sz_src, size_t sz_query); /* Check if a given character is a text token*/ bool is_token(char c); +/* Generate the compiled token pair for a given single sized markdown token */ +char **get_token_pair(char c); #endif // __COMPILER_H_ -- cgit v1.2.3-13-gbd6f