internal unsafe SyntaxException(StringGraphQLReader reader, string message)
     : base(message)
 {
     Position = reader.Position;
     Line     = reader.Line;
     Column   = reader.Column;
     fixed(char *c = reader.GraphQLData)
     {
         SourceText = new string(c, 0, reader.GraphQLData.Length);
     }
 }
        internal StringGraphQLParser(StringGraphQLReader reader)
        {
            if (reader.Kind == TokenKind.EndOfFile)
            {
                throw new ArgumentException(
                          LangResources.GraphQLData_Empty,
                          nameof(reader));
            }

            _reader      = reader;
            _description = null;
        }
        public StringGraphQLParser(ReadOnlySpan <char> graphQLData)
        {
            if (graphQLData.Length == 0)
            {
                throw new ArgumentException(
                          LangResources.GraphQLData_Empty,
                          nameof(graphQLData));
            }

            _reader      = new StringGraphQLReader(graphQLData);
            _description = null;
        }
Beispiel #4
0
        internal StringGraphQLClassifier(
            StringGraphQLReader reader,
            ICollection <SyntaxClassification> classifications)
        {
            if (reader.Kind == TokenKind.EndOfFile)
            {
                throw new ArgumentException(
                          LangResources.GraphQLData_Empty,
                          nameof(reader));
            }

            if (classifications is null)
            {
                throw new ArgumentNullException(nameof(classifications));
            }

            _classifications = classifications;
            _reader          = reader;
        }
Beispiel #5
0
        public StringGraphQLClassifier(
            ReadOnlySpan <char> graphQLData,
            ICollection <SyntaxClassification> classifications)
        {
            if (graphQLData.Length == 0)
            {
                throw new ArgumentException(
                          LangResources.GraphQLData_Empty,
                          nameof(graphQLData));
            }

            if (classifications is null)
            {
                throw new ArgumentNullException(nameof(classifications));
            }

            _classifications = classifications;
            _reader          = new StringGraphQLReader(graphQLData);
        }