Ejemplo n.º 1
0
        private LineDirectivePositionSyntax ParseLineDirectivePosition(ref bool reportError, out int line, out int character)
        {
            var openParen = EatToken(SyntaxKind.OpenParenToken, reportError);

            if (openParen.IsMissing)
            {
                reportError = false;
            }

            var lineToken = ParseLineDirectiveNumericLiteral(ref reportError, minValue: 1, maxValue: MaxLineValue, out line);

            var comma = EatToken(SyntaxKind.CommaToken, reportError);

            if (comma.IsMissing)
            {
                reportError = false;
            }

            var characterToken = ParseLineDirectiveNumericLiteral(ref reportError, minValue: 1, maxValue: MaxCharacterValue, out character);

            var closeParen = EatToken(SyntaxKind.CloseParenToken, reportError);

            if (closeParen.IsMissing)
            {
                reportError = false;
            }

            return(SyntaxFactory.LineDirectivePosition(openParen, lineToken, comma, characterToken, closeParen));
        }