- Open Roslyn.sln in Visual Studio 2017
- Open source file %REPO_ROOT%\src\Compilers\CSharp\Portable\Parser\Lexer.cs and add the highlighted else if statement at line 565 in the method ScanSyntaxToken:
case '?': if (TextWindow.PeekChar() == '?') { ... } else if (TextWindow.PeekChar() == ':') { TextWindow.AdvanceChar(); info.Kind = SyntaxKind.QuestionColonToken; } else { ... }
- Open source file %REPO_ROOT%\src\Compilers\CSharp\Portable\Parser\LanguageParser.cs and add the highlighted else if statement at line 9426 in the method ParseSubExpressionCore:
if (tk == SyntaxKind.QuestionToken && precedence <= Precedence.Ternary){ ...}else if (tk == SyntaxKind.QuestionColonToken && precedence <= Precedence.Ternary){ var questionColonToken ...