Skip to content

Commit

Permalink
removed query parameters annotations (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
swilly22 committed May 13, 2020
1 parent 1295ccb commit d32d02b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 119 deletions.
13 changes: 0 additions & 13 deletions src/ast/ast_annotations_ctx_collection.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
AST_AnnotationCtxCollection *AST_AnnotationCtxCollection_New() {
AST_AnnotationCtxCollection *anotCtxCollection = rm_malloc(sizeof(AST_AnnotationCtxCollection));
anotCtxCollection->name_ctx = NULL;
anotCtxCollection->params_ctx = NULL;
anotCtxCollection->named_paths_ctx = NULL;
anotCtxCollection->project_all_ctx = NULL;
return anotCtxCollection;
Expand All @@ -21,11 +20,6 @@ inline AnnotationCtx *AST_AnnotationCtxCollection_GetNameCtx(const AST_Annotatio
return anot_ctx_collection->name_ctx;
}

inline AnnotationCtx *AST_AnnotationCtxCollection_GetParamsCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection) {
return anot_ctx_collection->params_ctx;
}

inline AnnotationCtx *AST_AnnotationCtxCollection_GetNamedPathsCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection) {
return anot_ctx_collection->named_paths_ctx;
Expand All @@ -41,12 +35,6 @@ inline void AST_AnnotationCtxCollection_SetNameCtx(AST_AnnotationCtxCollection *
anot_ctx_collection->name_ctx = name_ctx;
}

inline void AST_AnnotationCtxCollection_SetParamsCtx(AST_AnnotationCtxCollection
*anot_ctx_collection,
AnnotationCtx *params_ctx) {
anot_ctx_collection->params_ctx = params_ctx;
}

inline void AST_AnnotationCtxCollection_SetNamedPathsCtx(AST_AnnotationCtxCollection
*anot_ctx_collection,
AnnotationCtx *named_paths_ctx) {
Expand All @@ -62,7 +50,6 @@ inline void AST_AnnotationCtxCollection_SetProjectAllCtx(AST_AnnotationCtxCollec
void AST_AnnotationCtxCollection_Free(AST_AnnotationCtxCollection *anotCtxCollection) {
if(anotCtxCollection) {
if(anotCtxCollection->name_ctx) cypher_ast_annotation_context_free(anotCtxCollection->name_ctx);
if(anotCtxCollection->params_ctx) cypher_ast_annotation_context_free(anotCtxCollection->params_ctx);
if(anotCtxCollection->named_paths_ctx) cypher_ast_annotation_context_free(
anotCtxCollection->named_paths_ctx);
if(anotCtxCollection->project_all_ctx) cypher_ast_annotation_context_free(
Expand Down
31 changes: 11 additions & 20 deletions src/ast/ast_annotations_ctx_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,23 @@ typedef cypher_ast_annotation_context_t AnnotationCtx;
* specific AST nodes annotation use case. For each context there is a dedicated inlined
* getter and setter. */
typedef struct {
AnnotationCtx *name_ctx; // Annotation context for naming graph entities and ORDER items.
AnnotationCtx *params_ctx; // Annotation context for query parameters.
AnnotationCtx *name_ctx; // Annotation context for naming graph entities and ORDER items.
AnnotationCtx *project_all_ctx; // Context containing aliases for WITH/RETURN * projections.
AnnotationCtx *named_paths_ctx; // Annotation context for named paths projections.
} AST_AnnotationCtxCollection;

AST_AnnotationCtxCollection *AST_AnnotationCtxCollection_New();

AnnotationCtx *AST_AnnotationCtxCollection_GetNameCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection);
AnnotationCtx *AST_AnnotationCtxCollection_GetParamsCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection);
AnnotationCtx *AST_AnnotationCtxCollection_GetNamedPathsCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection);
AnnotationCtx *AST_AnnotationCtxCollection_GetProjectAllCtx(const AST_AnnotationCtxCollection
*anot_ctx_collection);

void AST_AnnotationCtxCollection_SetNameCtx(AST_AnnotationCtxCollection *anot_ctx_collection,
AnnotationCtx *name_ctx);
void AST_AnnotationCtxCollection_SetParamsCtx(AST_AnnotationCtxCollection *anot_ctx_collection,
AnnotationCtx *params_ctx);
void AST_AnnotationCtxCollection_SetNamedPathsCtx(AST_AnnotationCtxCollection *anot_ctx_collection,
AnnotationCtx *named_paths_ctx);
void AST_AnnotationCtxCollection_SetProjectAllCtx(AST_AnnotationCtxCollection *anot_ctx_collection,
AnnotationCtx *project_all_ctx);
AnnotationCtx *AST_AnnotationCtxCollection_GetNameCtx(const AST_AnnotationCtxCollection *anot_ctx_collection);

void AST_AnnotationCtxCollection_Free(AST_AnnotationCtxCollection *anot_ctx_collection);
AnnotationCtx *AST_AnnotationCtxCollection_GetNamedPathsCtx(const AST_AnnotationCtxCollection *anot_ctx_collection);

AnnotationCtx *AST_AnnotationCtxCollection_GetProjectAllCtx(const AST_AnnotationCtxCollection *anot_ctx_collection);

void AST_AnnotationCtxCollection_SetNameCtx(AST_AnnotationCtxCollection *anot_ctx_collection, AnnotationCtx *name_ctx);

void AST_AnnotationCtxCollection_SetNamedPathsCtx(AST_AnnotationCtxCollection *anot_ctx_collection, AnnotationCtx *named_paths_ctx);

void AST_AnnotationCtxCollection_SetProjectAllCtx(AST_AnnotationCtxCollection *anot_ctx_collection, AnnotationCtx *project_all_ctx);

void AST_AnnotationCtxCollection_Free(AST_AnnotationCtxCollection *anot_ctx_collection);
2 changes: 0 additions & 2 deletions src/ast/ast_enrich.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/

#include "enrichment/annotate_entities.h"
#include "enrichment/annotate_params.h"
#include "enrichment/annotate_project_all.h"
#include "enrichment/annotate_projected_named_paths.h"

Expand All @@ -20,6 +19,5 @@ void AST_Enrich(AST *ast) {
AST_AnnotateEntities(ast);
AST_AnnotateProjectAll(ast);
AST_AnnotateNamedPaths(ast);
AST_AnnotateParams(ast);
}

73 changes: 0 additions & 73 deletions src/ast/enrichment/annotate_params.c

This file was deleted.

11 changes: 0 additions & 11 deletions src/ast/enrichment/annotate_params.h

This file was deleted.

0 comments on commit d32d02b

Please sign in to comment.