/// <param name="cmd"></param> /// <param name="component">INodeInfo component for searching.</param> /// <param name="raw">Full raw string to search.</param> /// <returns></returns> protected IEnumerable <INodeInfo> Find(KDataCommand cmd, INodeInfo component, string raw) { if (raw == null) { if (cmd == KDataCommand.CtrlSpace || cmd == KDataCommand.Space) { return(ListInfo(new NodeIdent(component.Name, null))); } return(ListNull); } if (cmd == KDataCommand.Space) { return(ListNull); } string ident = new StringHandler().ProtectMixedQuotes(raw.Trim()); if (IsLatest('.', ident)) { ident = ident.Substring(0, ident.Length - 1); if (cmd == KDataCommand.CtrlSpace) { cmd = KDataCommand.LevelByDot; } } if (cmd == KDataCommand.CtrlSpace) { if (Regex.IsMatch(raw, Pattern.Finalization, RegexOptions.IgnorePatternWhitespace)) { return(ListNull); } } string[] parts = Regex.Replace ( ident, SobaScript.Pattern.RoundBracketsContent, "()", RegexOptions.IgnorePatternWhitespace ) .Split('.'); NodeIdent id = new NodeIdent(component.Name, null); for (int i = 0; i < parts.Length; ++i) { parts[i] = parts[i].Trim(); if (cmd == KDataCommand.CtrlSpace && i == parts.Length - 1) { return(ListInfo(id, parts[i])); } INodeInfo info = InfoBy(parts[i], id, (cmd == KDataCommand.LevelByDot)); if (info == null) { return(ListEmpty); } id = info.Link; } if (cmd == KDataCommand.LevelByDot) { return(ListInfo(id)); } return(ListEmpty); }