예제 #1
0
        void ParseInstruction(int baseoff, int offset, string line, ParseCallback callback)
        {
            int i     = 0;
            var parts = line.Split(new[] { ' ', '\t', ',', '+', '-', '*', ':' }, StringSplitOptions.None);
            ClassifierDefinition definition = null;

            foreach (var part in parts)
            {
                if (part.StartsWith("?"))
                {
                    callback(null, Constants.classifier_asm_cxxdecname, baseoff + offset + i, part.Trim().Length);
                }
                else if (m_ClassifierDictionary.TryGetValue(part, out definition))
                {
                    callback(definition, definition.classifier, baseoff + offset + i, part.Length);
                }
                i += part.Length;
                i++;
            }
        }
예제 #2
0
 protected ClassificationSpan CreateClassificationSpan(SnapshotSpan span, int start, int length, IClassificationType clsty, ClassifierDefinition definition)
 {
     return(new HurunaClassificationSpan(
                new SnapshotSpan(span.Snapshot, new Span(start, length)), clsty)
     {
         Definition = definition
     });
 }