Ejemplo n.º 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
     });
 }
Ejemplo n.º 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
                });
            }
Ejemplo n.º 3
0
 public Highlighter(SyntaxHighlighting highlighting, HighlightState state)
 {
     this.highlighting = highlighting;
     this.state        = state;
 }