/// <inheritdoc/> public HighlightingRuleSet GetNamedRuleSet(string name) { if (EnsureDefinition()) { return(_definition.GetNamedRuleSet(name)); } return(null); }
HighlightingRuleSet GetRuleSet(XshdElement position, XshdReference<XshdRuleSet> ruleSetReference) { if (ruleSetReference.InlineElement != null) { return (HighlightingRuleSet)ruleSetReference.InlineElement.AcceptVisitor(this); } else if (ruleSetReference.ReferencedElement != null) { IHighlightingDefinition definition = GetDefinition(position, ruleSetReference.ReferencedDefinition); HighlightingRuleSet ruleSet = definition.GetNamedRuleSet(ruleSetReference.ReferencedElement); if (ruleSet == null) throw Error(position, "Could not find rule set named '" + ruleSetReference.ReferencedElement + "'."); return ruleSet; } else { return null; } }