Пример #1
0
        public DietTemplateSyntaxMode()
        {
            var matches = new List <Match>();

            if (baseMode == null)
            {
                var provider = new ResourceStreamProvider(
                    typeof(DietTemplateSyntaxMode).Assembly,
                    typeof(DietTemplateSyntaxMode).Assembly.GetManifestResourceNames().First(s => s.Contains("DietTemplateSyntaxDefinition")));
                using (var s = provider.Open())
                    baseMode = SyntaxMode.Read(s);
            }

            this.rules    = new List <Rule>(baseMode.Rules);
            this.keywords = new List <Keywords>(baseMode.Keywords);
            this.spans    = new List <Span>(baseMode.Spans.Where(span => span.Begin.Pattern != "#")).ToArray();
            matches.AddRange(baseMode.Matches);
            this.prevMarker    = baseMode.PrevMarker;
            this.SemanticRules = new List <SemanticRule>(baseMode.SemanticRules);
            SemanticRules.Add(InlineDHighlighting.Instance);
            this.keywordTable           = baseMode.keywordTable;
            this.keywordTableIgnoreCase = baseMode.keywordTableIgnoreCase;
            this.properties             = baseMode.Properties;

            // D Number literals
            matches.Add(DSyntaxMode.workaroundMatchCtor(
                            "Number"
                            , @"				(?<!\w)(0((x|X)[0-9a-fA-F_]+|(b|B)[0-1_]+)|([0-9]+[_0-9]*)[L|U|u|f|i]*)"));

            this.matches = matches.ToArray();
        }
Пример #2
0
 public DSpanParser(DSyntaxMode syn, DocumentLine line, CloneableStack<Span> spanStack)
     : base(syn, spanStack)
 {
 }
Пример #3
0
 public DiffbasedChunkParser(DSyntaxMode syn, SpanParser s, ColorScheme st, DocumentLine ln)
     : base(syn, s, st, ln)
 {
 }
Пример #4
0
 public DiffbasedChunkParser(DSyntaxMode syn, SpanParser s, ColorScheme st, DocumentLine ln)
     : base(syn, s, st, ln)
 {
 }
Пример #5
0
 public DSpanParser(DSyntaxMode syn, DocumentLine line, CloneableStack <Span> spanStack)
     : base(syn, spanStack)
 {
 }