public static tokenizerForPath(filePath as String, firstLine as String = "") as Tokenizer
Resolves the appropriate Tokenizer for a file path or #! shebang line.
| Parameter | Description |
|---|---|
filePath | File path or filename. |
firstLine | Optional first line of the file for #! shebang detection. |
Resolved Tokenizer.
import klyn.code
tok = LanguageRegistry.tokenizerForPath("script.py")
assert tok.profile().id == "python"