Acquarella.Lexers.Lexer.Configure C# (CSharp) 메소드

Configure() 공개 메소드

public Configure ( LexerConfiguration config ) : void
config Acquarella.Configuration.LexerConfiguration
리턴 void
        public void Configure(LexerConfiguration config)
        {
            if (config == null)
                return;

            if (config.Keywords != null)
                if (this.keywords == null)
                    this.keywords = config.Keywords;
                else
                    this.keywords = this.keywords.Union(config.Keywords).ToList();

            if (config.Operators != null)
                if (this.operators == null)
                    this.operators = config.Operators;
                else
                    this.operators = this.operators.Union(config.Operators).ToList();

            if (config.StringDelimeters != null)
                if (this.stringdelimeters == null)
                    this.stringdelimeters = config.StringDelimeters;
                else
                    this.stringdelimeters = this.stringdelimeters.Union(config.StringDelimeters).ToList();

            if (config.LineComments != null)
                if (this.linecomments == null)
                    this.linecomments = config.LineComments;
                else
                    this.linecomments = this.linecomments.Union(config.LineComments).ToList();
        }

Same methods

Lexer::Configure ( string name ) : void

Usage Example

예제 #1
0
        public static string Renderer(string text, string language, string style)
        {
            Lexer lexer = new Lexer();

            if (IsFilename(language))
                lexer.ConfigureFromFile(language);
            else
                lexer.Configure(language);

            TextRenderer renderer = new TextRenderer(lexer);

            if (IsFilename(style))
                renderer.ConfigureFromFile(style);
            else
                renderer.Configure(style);

            return renderer.Render(text);
        }
All Usage Examples Of Acquarella.Lexers.Lexer::Configure