Skip to content

Commit 415a80e

Browse files
committed
Simplify parse tree traversal
1 parent 448d491 commit 415a80e

10 files changed

+533
-758
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ if(WIN32)
99
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
1010
endif()
1111

12+
add_library(graphqlpeg GraphQLTree.cpp)
1213
add_library(graphqlservice GraphQLService.cpp Introspection.cpp IntrospectionSchema.cpp)
1314
add_executable(schemagen SchemaGenerator.cpp)
1415

16+
find_package(pegtl CONFIG REQUIRED)
17+
18+
target_include_directories(graphqlpeg INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}> $<INSTALL_INTERFACE:include>)
19+
target_link_libraries(graphqlpeg taocpp::pegtl)
20+
1521
find_package(cpprestsdk REQUIRED)
1622
set(CPPRESTSDK cpprestsdk::cpprest)
1723

@@ -20,12 +26,6 @@ if(UNIX)
2026
list(APPEND CPPRESTSDK ${BOOST_SYSTEM})
2127
endif()
2228

23-
find_package(pegtl CONFIG REQUIRED)
24-
25-
add_library(graphqlpeg GraphQLGrammar.cpp)
26-
target_include_directories(graphqlpeg INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}> $<INSTALL_INTERFACE:include>)
27-
target_link_libraries(graphqlpeg taocpp::pegtl)
28-
2929
target_include_directories(graphqlservice INTERFACE $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}> $<INSTALL_INTERFACE:include>)
3030
target_link_libraries(graphqlservice ${CPPRESTSDK} graphqlpeg)
3131
target_link_libraries(schemagen ${CPPRESTSDK} graphqlpeg)

GraphQLGrammar.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66

77
#pragma once
88

9-
#include "GraphQLService.h"
10-
119
#include <tao/pegtl.hpp>
1210

1311
namespace facebook {
1412
namespace graphql {
15-
namespace grammar {
13+
namespace peg {
1614

1715
using namespace tao::pegtl;
1816

@@ -797,9 +795,6 @@ struct document
797795
{
798796
};
799797

800-
std::unique_ptr<ast_node> parseString(const char* text);
801-
std::unique_ptr<ast_node> parseFile(file_input<>&& in);
802-
803-
} /* namespace grammar */
798+
} /* namespace peg */
804799
} /* namespace graphql */
805800
} /* namespace facebook */

0 commit comments

Comments
 (0)