The language module

This module provides the Language class, which serves as the base class for all language definitions.

Additionally, there are some utility functions to manage and query built-in language definitions.

class Language[source]

Bases: object

A Language represents a set of Lexicons comprising a specific language.

A Language is never instantiated. The class itself serves as a namespace and can be inherited from.

classmethod comment_common()[source]

Provides subtle highlighting within comments.

The default implementation highlights words like TODO, XXX, TEMP, etc. using Comment.Alert, and highlights URLs and email addresses with the Comment.Url and Comment.Email action respectively. Most bundled languages use this method for their comment lexicons.

get_all_modules()[source]

Return the sorted list of module names in parce.lang.

Modules that start with an underscore are skipped.

get_languages(name)[source]

Yield the Language subclasses defined in the module name.

The module name must be one of the modules returned by :meth:get_all_modules.

get_all_languages()[source]

Import all modules in parce.lang and yield all defined classes that inherit from Language.