klyn.code.LanguageRegistry.tokenizerForPath
method
public static tokenizerForPath(filePath as String, firstLine as String = "") as Tokenizer
Description

Resolves the appropriate Tokenizer for a file path or #! shebang line.

Parameters
ParameterDescription
filePathFile path or filename.
firstLineOptional first line of the file for #! shebang detection.
Returns

Resolved Tokenizer.

Example
import klyn.code

tok = LanguageRegistry.tokenizerForPath("script.py")
assert tok.profile().id == "python"