Skip to content

Implemented NextAre - #1001

Merged
pharring merged 4 commits into
dotnet:masterfrom
AdamSpeight2008:(NextAre)
Mar 6, 2015
Merged

Implemented NextAre#1001
pharring merged 4 commits into
dotnet:masterfrom
AdamSpeight2008:(NextAre)

Conversation

@AdamSpeight2008

Copy link
Copy Markdown
Contributor

This function encapsulates a common coding pattern in the scanner
source. That of a CanGetCharAtOffset( ) followed by multiple multiple
PeekAheadChar( ) and comparison checks. As a result the scanner source
is a bit better to work with.

Fixes #954

This function encapsulates a common coding pattern in the scanner
source. That of a `CanGetCharAtOffset( )` followed by multiple multiple
`PeekAheadChar( )` and comparison checks. As a result the scanner source
is a bit better to work with.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please separate method declarations with an empty line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So noted and added in 6396a55

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please rewrite this method for clarity as suggested by @pharring In the issue thread?

@AdamSpeight2008

Copy link
Copy Markdown
Contributor Author

Issue the test fails on my machine, could be a locale issue.

  Microsoft.CodeAnalysis.Scripting.VisualBasic.UnitTests.dll                  P
  ASSED 00:00:04.7349993
  Roslyn.ExpressionEvaluator.VisualBasic.ResultProvider.UnitTests.dll         P
  ASSED 00:00:06.6105703
  Roslyn.InteractiveWindow.UnitTests.dll                                      P
  ASSED 00:00:06.7510835
  Roslyn.CodeAnalysis.Analyzers.UnitTests.dll                                 P
  ASSED 00:00:06.9996715
  Roslyn.ExpressionEvaluator.CSharp.ResultProvider.UnitTests.dll              P
  ASSED 00:00:08.3420371
  Roslyn.Diagnostics.Analyzers.UnitTests.dll                                  P
  ASSED 00:00:09.2335984
  Microsoft.CodeAnalysis.Scripting.CSharp.UnitTests.dll                       P
  ASSED 00:00:09.2962544
  Roslyn.Services.CSharp.UnitTests.dll                                        P
  ASSED 00:00:10.2649301
  Roslyn.Compilers.CSharp.WinRT.UnitTests.dll                                 P
  ASSED 00:00:10.3435912
  Roslyn.Compilers.UnitTests.dll                                              F
  AILED 00:00:14.0007132
  Roslyn.Services.VisualBasic.UnitTests.dll                                   P
  ASSED 00:00:15.4228666
  Roslyn.Diagnostics.Analyzers.FxCop.UnitTests.dll                            P
  ASSED 00:00:18.4523072
  Roslyn.Compilers.CSharp.Syntax.UnitTests.dll                                P
  ASSED 00:00:23.8590938
  System.Runtime.Analyzers.UnitTests.dll                                      P
  ASSED 00:00:32.2665194
  Roslyn.Compilers.CSharp.CommandLine.UnitTests.dll                           P
  ASSED 00:00:49.0305206
  Roslyn.Compilers.VisualBasic.Syntax.UnitTests.dll                           P
  ASSED 00:00:50.5781173
  Roslyn.Compilers.VisualBasic.Symbol.UnitTests.dll                           P
  ASSED 00:01:29.8140241
  Roslyn.Compilers.CSharp.Symbol.UnitTests.dll                                P
  ASSED 00:02:11.5932648
  Roslyn.Compilers.CompilerServer.UnitTests.dll                               P
  ASSED 00:02:23.3596954
  Roslyn.Compilers.VisualBasic.CommandLine.UnitTests.dll                      P
  ASSED 00:02:31.6242721
  Roslyn.InteractiveHost.UnitTests.dll                                        P
  ASSED 00:03:01.9218102
  Roslyn.Compilers.CSharp.Semantic.UnitTests.dll                              P
  ASSED 00:03:05.5788733
  Roslyn.Compilers.VisualBasic.Semantic.UnitTests.dll                         P
  ASSED 00:03:24.6569575
  Roslyn.Services.UnitTests.dll                                               P
  ASSED 00:03:31.1855077
  Roslyn.Services.Editor.UnitTests2.dll                                       P
  ASSED 00:04:17.5947250
  Roslyn.Compilers.VisualBasic.Emit.UnitTests.dll                             P
  ASSED 00:04:27.4823144
  Roslyn.Services.Editor.UnitTests.dll                                        P
  ASSED 00:04:45.6093400
  Roslyn.Compilers.CSharp.Emit.UnitTests.dll                                  P
  ASSED 00:07:03.7178167
  Roslyn.Services.Editor.CSharp.UnitTests.dll                                 P
  ASSED 00:08:09.5316276
  Roslyn.Services.Editor.VisualBasic.UnitTests.dll                            P
  ASSED 00:10:00.4379029
  ================
  Test failures encountered: 00:33:43.5014486

Extracted Test Failure

      <test name="Microsoft.CodeAnalysis.UnitTests.Diagnostics.DiagnosticLocalizationTests.TestDiagnosticLocalization" type="Microsoft.CodeAnalysis.UnitTests.Diagnostics.DiagnosticLocalizationTests" method="TestDiagnosticLocalization" time="0.042" result="Fail">
        <failure exception-type="System.Collections.Generic.KeyNotFoundException">
          <message><![CDATA[System.Collections.Generic.KeyNotFoundException : The given key was not present in the dictionary.]]></message>
          <stack-trace><![CDATA[   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Microsoft.CodeAnalysis.UnitTests.Diagnostics.DiagnosticLocalizationTests.CustomResourceManager.GetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) in C:\Users\Adam\Documents\GitHub\roslyn\Src\Compilers\Core\CodeAnalysisTest\Diagnostics\DiagnosticLocalizationTests.cs:line 183
   at Microsoft.CodeAnalysis.UnitTests.Diagnostics.DiagnosticLocalizationTests.CustomResourceManager.GetString(String name, CultureInfo culture) in C:\Users\Adam\Documents\GitHub\roslyn\Src\Compilers\Core\CodeAnalysisTest\Diagnostics\DiagnosticLocalizationTests.cs:line 178
   at Microsoft.CodeAnalysis.LocalizableResourceString.ToString(IFormatProvider formatProvider) in C:\Users\Adam\Documents\GitHub\roslyn\Src\Compilers\Core\Portable\Diagnostic\LocalizableResourceString.cs:line 111
   at Microsoft.CodeAnalysis.LocalizableString.ToString() in C:\Users\Adam\Documents\GitHub\roslyn\Src\Compilers\Core\Portable\Diagnostic\LocalizableString.cs:line 32
   at Microsoft.CodeAnalysis.UnitTests.Diagnostics.DiagnosticLocalizationTests.TestDiagnosticLocalization() in C:\Users\Adam\Documents\GitHub\roslyn\Src\Compilers\Core\CodeAnalysisTest\Diagnostics\DiagnosticLocalizationTests.cs:line 67]]></stack-trace>
        </failure>
      </test>

Yep that the only failure.

@gafter

gafter commented Mar 4, 2015

Copy link
Copy Markdown
Member

👍

@gafter gafter self-assigned this Mar 4, 2015
@gafter gafter added the 4 - In Review A fix for the issue is submitted for review. label Mar 4, 2015
@gafter gafter added this to the 1.0-rc2 milestone Mar 4, 2015
@AdamSpeight2008

Copy link
Copy Markdown
Contributor Author

I've just spotted how I copied the test results. 😆

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line?

Using a different implementation, for clarity.
@pharring

pharring commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Sorry, @AdamSpeight2008, one last thing. Please remove the blank line on line 1158
After that, this will be good to merge.

Also tidy up character sequences.
pharring added a commit that referenced this pull request Mar 6, 2015
@pharring
pharring merged commit f8dc89d into dotnet:master Mar 6, 2015
@pharring

pharring commented Mar 6, 2015

Copy link
Copy Markdown
Contributor

@AdamSpeight2008 Thanks for the contribution.

@gafter gafter removed the 4 - In Review A fix for the issue is submitted for review. label Mar 6, 2015
@AdamSpeight2008
AdamSpeight2008 deleted the (NextAre) branch October 31, 2015 22:30
@gafter gafter added the Resolution-Won't Fix A real bug, but Triage feels that the issue is not impactful enough to spend time on. label Dec 9, 2015
dibarbet pushed a commit that referenced this pull request Aug 18, 2026
…onalreferences

Propogate AdditionalReferences in project state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Compilers Resolution-Won't Fix A real bug, but Triage feels that the issue is not impactful enough to spend time on.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(Proposal) Make Multiple PeekAheadChar( ) Comparisions simpler

5 participants