gitql_parser/
context.rs

1use std::collections::HashMap;
2
3use gitql_ast::statement::AggregateValue;
4use gitql_ast::statement::WindowDefinition;
5use gitql_ast::statement::WindowValue;
6
7use crate::name_generator::NameGenerator;
8use crate::token::SourceLocation;
9
10#[derive(Default)]
11pub struct ParserContext {
12    pub aggregations: HashMap<String, AggregateValue>,
13
14    pub window_functions: HashMap<String, WindowValue>,
15    pub named_window_clauses: HashMap<String, WindowDefinition>,
16
17    pub selected_fields: Vec<String>,
18    pub hidden_selections: Vec<String>,
19
20    pub selected_tables: Vec<String>,
21    pub projection_names: Vec<String>,
22    pub projection_locations: Vec<SourceLocation>,
23
24    pub name_alias_table: HashMap<String, String>,
25    pub name_generator: NameGenerator,
26
27    pub is_single_value_query: bool,
28    pub has_select_statement: bool,
29    pub has_group_by_statement: bool,
30
31    pub inside_selections: bool,
32    pub inside_having: bool,
33    pub inside_order_by: bool,
34    pub inside_over_clauses: bool,
35}