360#define map_FORTRAN map_F77
362#define map_FERITE map_C
370#define map_GLSL map_C
523#define map_ZEPHIR map_PHP
551#define MAP_ENTRY(lang) [TM_PARSER_##lang] = {map_##lang, G_N_ELEMENTS(map_##lang)}
618 for (i = 0; i < map->
size; i++)
622 if (
entry->kind == kind)
634 for (i = 0; i < map->
size; i++)
638 if (
entry->type == type)
649 GHashTable *lang_map = g_hash_table_lookup(
subparser_map, GINT_TO_POINTER(lang));
653 lang_map = g_hash_table_new(g_direct_hash, g_direct_equal);
654 g_hash_table_insert(
subparser_map, GINT_TO_POINTER(lang), lang_map);
657 mapping = g_ptr_array_new();
658 for (i = 0; i < map_size; i++)
659 g_ptr_array_add(mapping, &map[i]);
661 g_hash_table_insert(lang_map, GINT_TO_POINTER(sublang), mapping);
665#define SUBPARSER_MAP_ENTRY(lang, sublang, map) add_subparser(TM_PARSER_##lang, TM_PARSER_##sublang, map, G_N_ELEMENTS(map))
676 GHashTable *lang_map;
681 subparser_map = g_hash_table_new(g_direct_hash, g_direct_equal);
685 lang_map = g_hash_table_lookup(
subparser_map, GINT_TO_POINTER(lang));
689 mapping = g_hash_table_lookup(lang_map, GINT_TO_POINTER(sublang));
693 for (i = 0; i < mapping->len; i++)
696 if (
entry->orig_type == type)
697 return entry->new_type;
709 g_error(
"More parsers defined in Geany than in ctags");
711 for (lang = 0; lang < TM_PARSER_COUNT; lang++)
715 gchar presence_map[256];
719 g_error(
"No tag types in TM for %s, is the language listed in parser_map?",
722 if (map->
size != strlen(kinds))
723 g_error(
"Different number of tag types in TM (%d) and ctags (%d) for %s",
726 memset(presence_map, 0,
sizeof(presence_map));
727 for (i = 0; i < map->
size; i++)
729 gboolean ctags_found = FALSE;
730 gboolean tm_found = FALSE;
733 for (j = 0; j < map->
size; j++)
741 if (ctags_found && tm_found)
745 g_error(
"Tag type '%c' found in TM but not in ctags for %s",
748 g_error(
"Tag type '%c' found in ctags but not in TM for %s",
751 presence_map[(
unsigned char) map->
entries[i].
kind]++;
754 for (i = 0; i <
sizeof(presence_map); i++)
756 if (presence_map[i] > 1)
757 g_error(
"Duplicate tag type '%c' found for %s",
773 case TM_PARSER_POWERSHELL:
775 case TM_PARSER_ZEPHIR:
784 case TM_PARSER_ASCIIDOC:
785 case TM_PARSER_TXT2TAGS:
799 case TM_PARSER_ACTIONSCRIPT:
802 case TM_PARSER_CSHARP:
803 case TM_PARSER_COBOL:
805 case TM_PARSER_FERITE:
808 case TM_PARSER_JAVASCRIPT:
811 case TM_PARSER_POWERSHELL:
812 case TM_PARSER_PYTHON:
816 case TM_PARSER_TXT2TAGS:
818 case TM_PARSER_ZEPHIR:
823 case TM_PARSER_ASCIIDOC:
825 case TM_PARSER_ERLANG:
827 case TM_PARSER_FORTRAN:
840 if (lang == TM_PARSER_NONE || other == TM_PARSER_NONE)
845 else if (lang == TM_PARSER_C && other == TM_PARSER_CPP)
847 else if (lang == TM_PARSER_CPP && other == TM_PARSER_C)
TMParserMapEntry * entries
static GHashTable * subparser_map
static TMParserMapEntry map_CSS[]
static TMParserMapEntry map_ACTIONSCRIPT[]
G_STATIC_ASSERT(G_N_ELEMENTS(parser_map)==TM_PARSER_COUNT)
static TMParserMapEntry map_JSON[]
static TMParserMapEntry map_HAXE[]
static TMParserMapEntry map_ABAQUS[]
static TMParserMapEntry map_F77[]
static TMParserMapEntry map_ABC[]
static TMParserMapEntry map_HASKELL[]
static TMParserMapEntry map_ERLANG[]
static TMParserMapEntry map_SH[]
static TMParserMapEntry map_HTML[]
static TMParserMapEntry map_JAVA[]
static TMParserMapEntry map_JULIA[]
static TMParserMapEntry map_CONF[]
gboolean tm_parser_has_full_context(TMParserType lang)
static TMParserMapEntry map_PHP[]
static TMParserMapEntry map_COBOL[]
static TMParserMapEntry map_C[]
static TMParserMapEntry map_MARKDOWN[]
static TMParserMapEntry map_MAKEFILE[]
static void init_subparser_map(void)
static TMParserMapEntry map_PERL[]
static TMParserMapEntry map_JAVASCRIPT[]
static TMParserMapEntry map_ASM[]
static TMParserMapEntry map_SQL[]
#define SUBPARSER_MAP_ENTRY(lang, sublang, map)
static TMParserMapEntry map_DIFF[]
gchar tm_parser_get_tag_kind(TMTagType type, TMParserType lang)
static TMParserMapEntry map_D[]
static TMParserMapEntry map_ASCIIDOC[]
static TMParserMapEntry map_FREEBASIC[]
static TMParserMapEntry map_BIBTEX[]
static TMParserMapEntry map_VHDL[]
static TMParserMapEntry map_TXT2TAGS[]
const gchar * tm_parser_context_separator(TMParserType lang)
static TMParserMapEntry map_LATEX[]
static TMParserMapEntry map_OBJC[]
static TMParserMapEntry map_VERILOG[]
static TMParserMapEntry map_POWERSHELL[]
static TMParserMapEntry map_VALA[]
static void add_subparser(TMParserType lang, TMParserType sublang, TMSubparserMapEntry *map, guint map_size)
static TMParserMap parser_map[]
static TMParserMapEntry map_RUST[]
static TMParserMapEntry map_CSHARP[]
static TMParserMapEntry map_LUA[]
static TMParserMapEntry map_PASCAL[]
gboolean tm_parser_langs_compatible(TMParserType lang, TMParserType other)
static TMParserMapEntry map_DOCBOOK[]
static TMParserMapEntry map_REST[]
static TMParserMapEntry map_RUBY[]
static TMSubparserMapEntry subparser_HTML_javascript_map[]
static TMParserMapEntry map_GO[]
static TMParserMapEntry map_MATLAB[]
void tm_parser_verify_type_mappings(void)
static TMParserMapEntry map_PYTHON[]
static TMParserMapEntry map_NSIS[]
static TMParserMapEntry map_R[]
TMTagType tm_parser_get_subparser_type(TMParserType lang, TMParserType sublang, TMTagType type)
static TMParserMapEntry map_TCL[]
TMTagType tm_parser_get_tag_type(gchar kind, TMParserType lang)
@ tm_tag_function_t
Function definition.
@ tm_tag_package_t
Package (Java only)
@ tm_tag_interface_t
Interface (Java only)
@ tm_tag_field_t
Field (Java only)
@ tm_tag_class_t
Class declaration.
@ tm_tag_enumerator_t
Enumerator value.
@ tm_tag_undef_t
Unknown type.
@ tm_tag_member_t
Member variable of class/struct.
@ tm_tag_method_t
Class method (Java only)
@ tm_tag_struct_t
Struct declaration.
@ tm_tag_namespace_t
Namespace declaration.
@ tm_tag_variable_t
Variable.
@ tm_tag_other_t
Other (non C/C++/Java tag)
@ tm_tag_prototype_t
Function prototype.
@ tm_tag_typedef_t
Typedef.
@ tm_tag_externvar_t
Extern or forward declaration.
@ tm_tag_enum_t
Enum declaration.
@ tm_tag_macro_t
Macro (without arguments)