public static HighlightState CreateNewState(SyntaxHighlighting highlighting) { return(new HighlightState { ContextStack = ImmutableStack <SyntaxContext> .Empty.Push(highlighting.definition.MainContext), ScopeStack = new ScopeStack(highlighting.definition.Scope), MatchStack = ImmutableStack <SyntaxMatch> .Empty }); }
public static HighlightState CreateNewState(SyntaxHighlighting highlighting) { if (highlighting == null) { throw new ArgumentNullException(nameof(highlighting)); } var definition = highlighting.definition; if (definition == null) { throw new NullReferenceException("HighlightState.CreateNewState null reference exception highlighting.definition == null."); } return(new HighlightState { ContextStack = ImmutableStack <SyntaxContext> .Empty.Push(definition.MainContext), ScopeStack = new ScopeStack(definition.Scope), MatchStack = ImmutableStack <SyntaxMatch> .Empty }); }
public Highlighter(SyntaxHighlighting highlighting, HighlightState state) { this.highlighting = highlighting; this.state = state; }