added parameter find_only_at_eol, to control whether to check only at EOL for the given scope, or to find the closest token matching that scope
added parameter find_only_at_eol, to control whether to check only at EOL for the given scope, or to find the closest token matching that scope