Reduce some repetitions in tag type mapping code
commitf147f36dafd3c3241c159faf9ac533b7b7d9c7ed
authorColomban Wendling <ban@herbesfolles.org>
Thu, 5 May 2016 12:37:18 +0000 (5 14:37 +0200)
committerJiří Techet <techet@gmail.com>
Fri, 6 May 2016 15:02:32 +0000 (6 17:02 +0200)
tree6082f4f07f9f89e2ba8edb02a15351127de25aff
parent0833974e1ed460f1c36b3e2408726345f256d6a3
Reduce some repetitions in tag type mapping code

* Use a streamlined name for each map, `map_LANGUAGE`, where `LANGUAGE`
  is the CTags parser name from tm_parser.h.  This allows some further
  automation.
* Make sure the maps are referenced at the correct index in
  `parser_map`, even if they were not in the same order as in the
  `TMParserType` enumeration by using explicit sub-object initializers.
* As explicit sub-object initialization might lead to a missing
  initializer for a non-last index going unnoticed, add a check for
  uninitialized entries to properly reject them even for regex parsers.
tagmanager/src/tm_parser.c