/*
* TinyBlocks - tb_syntax.h
* Library tinyblocks-syntax: realce de sintaxe (syntax highlight) de um texto
* em varias linguagens, devolvendo o texto colorido em XML.
* Independente do editor.
*
* O XML gerado tem a forma:
*
* int x...
* ...
*
* Cada linha do texto vira um elemento ; os trechos viram com o tipo
* do token e a cor (#rrggbb). Texto fora de tokens vira .
*/
#ifndef TINYBLOCKS_SYNTAX_H
#define TINYBLOCKS_SYNTAX_H
#include
TB_API const TinyBlocks_LibraryDescriptor* tb_syntax_get_library(void);
/* -- API C --- */
/* Realca `text` como `lang` e devolve XML (malloc; libere com free). */
TB_API char* tb_syntax_highlight(const char* text, const char* lang);
/* Realca `text` como um trecho de codigo C numa unica linha (sem ),
* util para assinaturas/hover. Devolve XML (malloc). */
TB_API char* tb_syntax_highlight_inline(const char* text, const char* lang);
/* Numero de linguagens conhecidas e o nome normalizado da i-esima. */
TB_API int tb_syntax_language_count(void);
TB_API const char* tb_syntax_language_name(int i);
/* Cor (#rrggbb) associada a um tipo de token ("kw", "str", "cmt", ...). */
TB_API const char* tb_syntax_type_color(const char* type);
/* Normaliza um nome/extensao de linguagem ("py" -> "python"); nunca NULL. */
TB_API const char* tb_syntax_normalize_lang(const char* lang);
TB_API const char* tb_syntax_last_error(void);
#endif /* TINYBLOCKS_SYNTAX_H */