MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / ParserOptions

Class ParserOptions

parser/options.h:24–63  ·  view source on GitHub ↗

Options for configuring the limits and features of the parser.

Source from the content-addressed store, hash-verified

22
23// Options for configuring the limits and features of the parser.
24struct ParserOptions final {
25 // Limit of the number of error recovery attempts made by the ANTLR parser
26 // when processing an input. This limit, when reached, will halt further
27 // parsing of the expression.
28 int error_recovery_limit = ::cel_parser_internal::kDefaultErrorRecoveryLimit;
29
30 // Limit on the amount of recursive parse instructions permitted when building
31 // the abstract syntax tree for the expression. This prevents pathological
32 // inputs from causing stack overflows.
33 int max_recursion_depth = ::cel_parser_internal::kDefaultMaxRecursionDepth;
34
35 // Limit on the number of codepoints in the input string which the parser will
36 // attempt to parse.
37 int expression_size_codepoint_limit =
38 ::cel_parser_internal::kExpressionSizeCodepointLimit;
39
40 // Limit on the number of lookahead tokens to consume when attempting to
41 // recover from an error.
42 int error_recovery_token_lookahead_limit =
43 ::cel_parser_internal::kDefaultErrorRecoveryTokenLookaheadLimit;
44
45 // Add macro calls to macro_calls list in source_info.
46 bool add_macro_calls = ::cel_parser_internal::kDefaultAddMacroCalls;
47
48 // Enable support for optional syntax.
49 bool enable_optional_syntax = false;
50
51 // Disable standard macros (has, all, exists, exists_one, filter, map).
52 bool disable_standard_macros = false;
53
54 // Enable hidden accumulator variable '@result' for builtin comprehensions.
55 bool enable_hidden_accumulator_var = true;
56
57 // Enables support for identifier quoting syntax:
58 // "message.`skewer-case-field`"
59 //
60 // Limited to field specifiers in select and message creation,
61 // enabled by default
62 bool enable_quoted_identifiers = true;
63};
64
65} // namespace cel
66

Callers 3

parser.hFile · 0.85
RunMethod · 0.85

Calls

no outgoing calls

Tested by 2

RunMethod · 0.68