MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / index_options

Function index_options

graphlite/src/ast/parser.rs:5033–5055  ·  view source on GitHub ↗

Parse index options (parameter=value, ...)

(tokens: &[Token])

Source from the content-addressed store, hash-verified

5031
5032/// Parse index options (parameter=value, ...)
5033fn index_options(tokens: &[Token]) -> IResult<&[Token], IndexOptions> {
5034 let (tokens, params) = delimited(
5035 expect_token(Token::LeftParen),
5036 separated_list1(
5037 expect_token(Token::Comma),
5038 tuple((
5039 identifier,
5040 preceded(expect_token(Token::Equal), parse_value),
5041 )),
5042 ),
5043 expect_token(Token::RightParen),
5044 )(tokens)?;
5045
5046 let parameters = params.into_iter().collect();
5047
5048 Ok((
5049 tokens,
5050 IndexOptions {
5051 parameters,
5052 location: Location::default(),
5053 },
5054 ))
5055}
5056
5057/// Parse value for index parameters
5058fn parse_value(tokens: &[Token]) -> IResult<&[Token], Value> {

Callers

nothing calls this directly

Calls 1

expect_tokenFunction · 0.85

Tested by

no test coverage detected