<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>Source/BooLangService/StringParsing/BracketPair.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/StringParsing/BracketPairCollection.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/StringParsing/BracketPairFinder.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/StringParsing/BracketPairType.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangService/StringParsing/ExcludingStringLiteralsStringWalker.cs</filename>
    </added>
    <added>
      <filename>Source/BooLangStudioSpecs/StringParsing/BracketPairFinderTests.cs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -118,6 +118,11 @@
     &lt;Compile Include=&quot;Document\ScopableAttribute.cs&quot; /&gt;
     &lt;Compile Include=&quot;AttributeHelper.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\Invocation.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\BracketPair.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\BracketPairCollection.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\BracketPairFinder.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\BracketPairType.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\ExcludingStringLiteralsStringWalker.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\LineEntityParser.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\StringPosition.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\StringWalker.cs&quot; /&gt;</diff>
      <filename>Source/BooLangService/BooLangService.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -134,30 +134,21 @@ namespace Boo.BooLangService
         {
             Debug.WriteLine(&quot;HighlightBraces&quot;);
 
-            var pairs = new Dictionary&lt;char, char&gt;
-            {
-                {'(', ')'},
-                {'{', '}'},
-                {'[', ']'}
-            };
             var source = languageService.GetSource(request.View);
+            var indexOfOriginal = source.GetPositionOfLineIndex(request.Line, request.Col - 1);
 
-            var stringMatcher = new ExcludeStringMatcher(request.Text);
-
-            int indexOfOriginal = source.GetPositionOfLineIndex(request.Line, request.Col - 1);
-            char original = request.Text[indexOfOriginal];
-
-            stringMatcher.SetStartIndex(indexOfOriginal);
+            var bracketFinder = new BracketPairFinder(BracketPairType.FromChar(request.Text[indexOfOriginal]));
+            var bracketPairs = bracketFinder.FindPairs(request.Text);
 
-            int? nextIndex = stringMatcher.FindNextIndex(pairs[original]);
+            int? partner = bracketPairs.FindPartnerIndex(indexOfOriginal);
 
-            if (nextIndex != null)
+            if (partner != null)
             {
                 request.Sink.FoundMatchingBrace = true;
 
                 int nextLine, nextCol;
 
-                source.GetLineIndexOfPosition(nextIndex.Value, out nextLine, out nextCol);
+                source.GetLineIndexOfPosition(partner.Value, out nextLine, out nextCol);
 
                 request.Sink.MatchPair(
                     new TextSpan</diff>
      <filename>Source/BooLangService/ParseRequestProcessor.cs</filename>
    </modified>
    <modified>
      <diff>@@ -34,10 +34,16 @@ namespace Boo.BooLangService.StringParsing
                 else if (currentChar == BackSlash &amp;&amp; StateIs(StringWalkerState.InsideString))
                     currentIndex += 1; // skip next (escaped) char
 
-                yield return new StringPosition(currentChar, currentIndex);
+                if (ShouldYield(currentChar))
+                    yield return new StringPosition(currentChar, currentIndex);
             }
         }
 
+        protected virtual bool ShouldYield(char currentChar)
+        {
+            return true;
+        }
+
         public bool StateIs(StringWalkerState expectedState)
         {
             if (state.Count == 0) return false;</diff>
      <filename>Source/BooLangService/StringParsing/StringWalker.cs</filename>
    </modified>
    <modified>
      <diff>@@ -104,7 +104,6 @@
     &lt;Compile Include=&quot;Intellisense\CaretNotFoundException.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\CompilationOutput.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\Constants.cs&quot; /&gt;
-    &lt;Compile Include=&quot;Intellisense\FakeAuthoringSink.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\FixtureCompiler.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\IntellisenseDeclarationsTestExtensionMethods.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\LineEntityParserTests.cs&quot; /&gt;
@@ -156,6 +155,7 @@
     &lt;Compile Include=&quot;Intellisense\WhenShowingIntellisenseInMethodBody.cs&quot; /&gt;
     &lt;Compile Include=&quot;Intellisense\WhenShowingToolTipForMethod.cs&quot; /&gt;
     &lt;Compile Include=&quot;Properties\AssemblyInfo.cs&quot; /&gt;
+    &lt;Compile Include=&quot;StringParsing\BracketPairFinderTests.cs&quot; /&gt;
     &lt;Compile Include=&quot;StringParsing\ExcludeStringMatcherTests.cs&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;</diff>
      <filename>Source/BooLangStudioSpecs/BooLangStudioSpecs.csproj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e0116dcaad0efb5fe766a59f1befb56213f51d12</id>
    </parent>
  </parents>
  <author>
    <name>James Gregory</name>
    <email>james@jagregory.com</email>
  </author>
  <url>http://github.com/jagregory/boolangstudio/commit/54d4bcef79d4dbd2ff6cf1fbd9b0a15f325f5c41</url>
  <id>54d4bcef79d4dbd2ff6cf1fbd9b0a15f325f5c41</id>
  <committed-date>2008-09-01T16:37:38-07:00</committed-date>
  <authored-date>2008-09-01T16:37:38-07:00</authored-date>
  <message>Some changes to brace matching. Changed the way brackets are found in the source, which allows highlighting to be done from left or right.</message>
  <tree>bda18d73a0d03eb226a5b5a79b351446ff365cfb</tree>
  <committer>
    <name>James Gregory</name>
    <email>james@jagregory.com</email>
  </committer>
</commit>
