klyn.code.DeclarationScanner.findDefinition
method
public static findDefinition(source as String, symbol as String, tokenizer as Tokenizer) as ArrayList<Long>
Description

Locates the first declaration of symbol in source using tokenizer. Returns [line, column] (0-based) or null if no declaration is found.

Parameters
ParameterDescription
sourceFull source code text.
symbolIdentifier name to resolve.
tokenizerLanguage tokenizer.
Returns

Two-element ArrayList<Long> [line, column] or null.

Example
import klyn.code
import klyn.code.ast

p = LanguageProfile("klyn", "Klyn").withDefinitionMode("klyn").withLineComments(["#"])
loc = DeclarationScanner.findDefinition("public class Order:\n    public total() as Int:\n        return 0", "total", CodeTokenizer(p))
assert loc is not null and loc[0] == 1