aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/clickhouse/src/Functions/JSONPath/Parsers/ParserJSONPathStar.cpp
blob: 1338a2064f1ab1e0409cd2f61968ccd3b9308dd3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <Functions/JSONPath/Parsers/ParserJSONPathStar.h>

#include <Functions/JSONPath/ASTs/ASTJSONPathStar.h>

namespace DB
{
bool ParserJSONPathStar::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
{
    if (pos->type != TokenType::OpeningSquareBracket)
    {
        return false;
    }
    ++pos;
    if (pos->type != TokenType::Asterisk)
    {
        return false;
    }
    ++pos;
    if (pos->type != TokenType::ClosingSquareBracket)
    {
        expected.add(pos, "Closing square bracket");
        return false;
    }
    ++pos;

    node = std::make_shared<ASTJSONPathStar>();

    return true;
}

}