mirror of
https://github.com/openappsec/openappsec.git
synced 2025-10-01 12:07:43 +03:00
Feb 15th 2023 update
This commit is contained in:
25
external/graphqlparser/c/GraphQLAstNode.cpp
vendored
Normal file
25
external/graphqlparser/c/GraphQLAstNode.cpp
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright 2019-present, GraphQL Foundation
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#include "GraphQLAstNode.h"
|
||||
#include "../AstNode.h"
|
||||
|
||||
using facebook::graphql::ast::Node;
|
||||
|
||||
void graphql_node_get_location(const struct GraphQLAstNode *node,
|
||||
struct GraphQLAstLocation *location) {
|
||||
const auto *realNode = reinterpret_cast<const Node *>(node);
|
||||
const auto &loc = realNode->getLocation();
|
||||
location->beginLine = loc.begin.line;
|
||||
location->beginColumn = loc.begin.column;
|
||||
location->endLine = loc.end.line;
|
||||
location->endColumn = loc.end.column;
|
||||
}
|
||||
|
||||
void graphql_node_free(struct GraphQLAstNode *node) {
|
||||
delete reinterpret_cast<Node *>(node);
|
||||
}
|
Reference in New Issue
Block a user