Esempio n. 1
0
        public override void Initialize(GrammarData grammarData)
        {
            base.Initialize(grammarData);

            // initialize string of start characters for fast lookup
            _startSymbolsFirsts = new string(StartSymbols.Select(s => s.First()).ToArray());

            if (EditorInfo == null)
            {
                EditorInfo = new TokenEditorInfo(TokenType.Delimiter, TokenColor.Comment, TokenTriggers.None);
            }
        }
Esempio n. 2
0
        private bool BeginMatch(ISourceStream source, int startFrom, char lookAhead)
        {
            foreach (var startSymbol in StartSymbols.Skip(startFrom))
            {
                if (startSymbol[0] != lookAhead)
                {
                    continue;
                }

                if (source.MatchSymbol(startSymbol))
                {
                    source.PreviewPosition += startSymbol.Length;
                    return(true);
                }
            }
            return(false);
        }