Ensure lexers can be looked up by name, alias and mime type

Issue #668 resolved
Anonymous created an issue

It seems like all lexers should be able to be found by their name and aliases via find_lexer_class and get_lexer_by_name. This implies that all lexers have a unique name and alias. I've created a test case for this. Almost all the lexers fit this property. The ECLexer doesn't match its function name, but I'm assuming this is a simple typo.

The other is the Makefile and BaseMakefile, both are called Makefile. So find_lexer_class will only see one but not the other. I'm not sure what the purpose of BaseMakefile is for, but it should probably have a different name.

I'm not sure about this half of the patch, but I think the same should probably hold for get_lexer_for_mimetype as well. The two conflicts are related to XML/XSLT and ActionScript which have shared mime types.

https://bitbucket.org/joshpeek/pygments/compare/default..birkenfeld/pygments-main

Comments (6)

  1. Log in to comment