Skip to content

Commit

Permalink
Merge pull request #2102 from techee/external_parser_list
Browse files Browse the repository at this point in the history
main: allow specifying alternative parser list
  • Loading branch information
techee committed May 22, 2019
2 parents ce48854 + 78d1a3f commit 3fdf28b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ static void uninstallTagXpathTable (const langType language);
*/
static parserDefinition *CTagsSelfTestParser (void);
static parserDefinitionFunc* BuiltInParsers[] = {
#ifdef EXTERNAL_PARSER_LIST
EXTERNAL_PARSER_LIST
#else /* ! EXTERNAL_PARSER_LIST */
CTagsSelfTestParser,
PARSER_LIST,
XML_PARSER_LIST
Expand All @@ -138,6 +141,7 @@ static parserDefinitionFunc* BuiltInParsers[] = {
#ifdef HAVE_PACKCC
,
#endif
#endif /* EXTERNAL_PARSER_LIST */
};
static parserObject* LanguageTable = NULL;
static unsigned int LanguageCount = 0;
Expand Down
7 changes: 7 additions & 0 deletions main/parse_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#include "parse.h"
#include "parsers_p.h" /* contains list of parsers */
#include "strlist.h"
#ifdef EXTERNAL_PARSER_LIST_FILE
#include EXTERNAL_PARSER_LIST_FILE
#endif

/*
* MACROS
Expand All @@ -41,6 +44,9 @@ typedef enum {
* return a structure allocated using parserNew(). This structure must,
* at minimum, set the `parser' field.
*/
#ifdef EXTERNAL_PARSER_LIST
extern parserDefinitionFunc EXTERNAL_PARSER_LIST;
#else /* ! EXTERNAL_PARSER_LIST */
extern parserDefinitionFunc PARSER_LIST;
#ifdef HAVE_LIBXML
extern parserDefinitionFunc XML_PARSER_LIST;
Expand All @@ -51,6 +57,7 @@ extern parserDefinitionFunc YAML_PARSER_LIST;
#ifdef HAVE_PACKCC
extern parserDefinitionFunc PEG_PARSER_LIST;
#endif
#endif /* EXTERNAL_PARSER_LIST */

extern bool doesLanguageAllowNullTag (const langType language);
extern bool doesLanguageRequestAutomaticFQTag (const langType language);
Expand Down

0 comments on commit 3fdf28b

Please sign in to comment.