예제 #1
0
 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
     });
 }
예제 #2
0
            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
                });
            }
예제 #3
0
 public Highlighter(SyntaxHighlighting highlighting, HighlightState state)
 {
     this.highlighting = highlighting;
     this.state        = state;
 }