1. 01 8月, 2018 2 次提交
    • C
      Introduce a virtual-char system for figuring out the escaped characters in a string-literal token · 83ecfdcf
      Cyrus Najmabadi 提交于
      From the #23984 PR:
      
      The first subsystem is called the VirtualCharService deals with the following issue. To the final .net regex, the following snippets of code appear completely identical to it:
      
      "\\1"       // In a normal string, we have to escape the \
      @"\1"       // But not in a verbatim string
      "\\\u0031"  // The '1' could be escaped
      "\\u005c1"  // Even the backslash *itself* may be escaped
      
      These are all ways of writing the \1 regex.
      
      In other words, C# allows a wide variety of input strings to all compile down to the same final 'value' (or 'ValueText') that the regex engine will finally see. This is a major issue as it means that any data reported by the regex engine must be accurate with respect to the text as the user wrote it. For example, in all of the equivalent cases above, there is the same error "Reference to undefined group number 1". However, for each form the user wrote, it's necessary to understand what the right value is to highlight as the problem. i.e.
      
      https://user-images.githubusercontent.com/4564579/34459671-5bb785b2-edab-11e7-8413-79c331ef373f.png
      
      and
      
      https://user-images.githubusercontent.com/4564579/34459672-6deb88dc-edab-11e7-8236-7ba7cd331247.png
      
      So, the purpose of the VirtualCharService is to translate all of the above pieces of user code to the same final set of characters the regex engine will see (specifically \ and 1) while also maintaining the knowledge of where those characters came from (for example, that 1 came from \u0031 in the last example). In essence, the VirtualCharService is able to produce the ValueText for any string literal, while having a mapping back from each character in the ValueText back to the original source span of the document that formed this.
      
      With the VirtualCharService user code can be translated into a common format that then can be processed uniformly. This means that the part of the system that actually tries to understand the regex does not need to know about the differences between @"" and "" strings, or the differences between C# and VB. It also means that it can be used by any roslyn language (for example, F#) if that is so desired.
      83ecfdcf
    • C
      add check for symbol.IsOverride when renaming a symbol (#28952) · 8d70d17d
      Carol Hu 提交于
      Add check for symbol.IsOverride when renaming a symbol
      8d70d17d
  2. 31 7月, 2018 13 次提交
  3. 30 7月, 2018 3 次提交
  4. 28 7月, 2018 6 次提交
  5. 27 7月, 2018 14 次提交
  6. 26 7月, 2018 2 次提交