public static register(profile as LanguageProfile, tokenizer as Tokenizer = null) as Void
Registers a custom or built-in LanguageProfile and its Tokenizer.
| Parameter | Description |
|---|---|
profile | Declarative LanguageProfile. |
tokenizer | Associated Tokenizer implementation (or null to create a default CodeTokenizer(profile)). |
import klyn.code
custom = LanguageProfile("dsl", "Custom DSL").withExtensions(["dsl"]).withKeywords(["rule", "when", "then"])
LanguageRegistry.register(custom, CodeTokenizer(custom))
assert LanguageRegistry.profileForId("dsl") is not null