Skip to content

Commit ea4fb84

Browse files
committed
added highlight
1 parent baee07e commit ea4fb84

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

VMCompiler/Form1.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,9 @@ private void Highlight(string text, int offset)
608608
richTextBox1.Select(match.Index + offset, 5);
609609
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#3498db");
610610

611+
richTextBox1.Select(match.Groups[1].Index + offset, match.Groups[1].Length);
612+
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#2ecc71");
613+
611614
richTextBox1.Select(match.Groups[1].Index + match.Groups[1].Length + offset, 1);
612615
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#3498db");
613616
}
@@ -643,6 +646,20 @@ private void Highlight(string text, int offset)
643646
richTextBox1.Select(match.Index + offset, 6);
644647
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#3498db");
645648
}
649+
650+
Regex callcsharp = new Regex(@"([a-zA-Z0-9]{1,})\:(.*?)\((.*)\)");
651+
MatchCollection callcsharpm = callcsharp.Matches(text);
652+
foreach (Match match in callcsharpm)
653+
{
654+
richTextBox1.Select(match.Groups[1].Index + offset, match.Groups[1].Length);
655+
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#27ae60");
656+
657+
richTextBox1.Select(match.Groups[2].Index + offset, match.Groups[2].Length);
658+
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#e67e22");
659+
660+
richTextBox1.Select(match.Groups[3].Index + offset, match.Groups[3].Length);
661+
richTextBox1.SelectionColor = ColorTranslator.FromHtml("#27ae60");
662+
}
646663
}
647664
}
648665
}

0 commit comments

Comments
 (0)