Language type
This section contains the reference for the implementation of tokei's LanguageType
struct.
LanguageType ¶
Represents a individual programming language.
Can be used to provide information about the language, such as multi line comments, single line comments, string literal syntax, whether a given language allows nesting comments.
Note
This is defined as a struct in rust. There may be a better way
of representing this object in python, but for the moment
its a class which has the corresponding LanguageType
represented underneath.
Warning
The following methods aren't currently implemented:
from_path
, from_file_extension
, from_mime
,
from_shebang
, parse
, parse_from_str
, parse_from_slice
.
Examples¶
>>> from pytokei import LanguageType
>>> python = LanguageType("Python")
>>> python
LanguageType(Python)
To see the languages defined, run the following:
References¶
tokei reference. The implementation of the different methods are here: ref
allows_nested ¶
Returns whether the language allows nested multi line comments.
important_syntax ¶
Returns the parts of syntax that determines whether tokei
can skip large parts of analysis.
is_literate ¶
Returns whether the language is "literate", meaning that it considered to primarily be documentation and is counted primarily as comments rather than procedural code.
nested_comments ¶
Returns what nested comments the language has. (Currently only D has any of this type.)