From 2cffbe92b3da759147076f17d38f74870238a244 Mon Sep 17 00:00:00 2001 From: dx Date: Thu, 7 May 2020 02:59:33 +0100 Subject: +token checker function This will check if a given character is a valid plain text token (*, _). This will allow me to abstract away and assess if some plain text needs to be further processed --- Converter/src/compiler.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Converter/src/compiler.c') diff --git a/Converter/src/compiler.c b/Converter/src/compiler.c index df97c22..042f809 100644 --- a/Converter/src/compiler.c +++ b/Converter/src/compiler.c @@ -9,6 +9,18 @@ int find_string(string src, string query, size_t sz_src, size_t sz_query) return j; } +bool is_token(char c) +{ + bool token_check = false; + for (int i = 0; i < N_TOKENS; ++i) + if (c == TOKENS[i]) + { + token_check = true; + break; + } + return token_check; +} + void compile_inner_text(string dest, string src, size_t sz_src, string line_or_source) { -- cgit v1.2.3-13-gbd6f