From 81880e000e1131f94f09e5333a7f08618631290b Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 23 Jun 2014 18:50:03 -0700 Subject: [PATCH] Tweak header include paths in tests --- spec/compiler/build_tables/build_parse_table_spec.cc | 2 +- spec/compiler/build_tables/conflict_manager_spec.cc | 4 ++-- spec/compiler/build_tables/first_set_spec.cc | 2 +- spec/compiler/build_tables/get_metadata_spec.cc | 2 +- spec/compiler/build_tables/item_set_closure_spec.cc | 4 ++-- spec/compiler/build_tables/item_set_transitions_spec.cc | 4 ++-- spec/compiler/build_tables/lex_item_spec.cc | 4 ++-- spec/compiler/build_tables/merge_transitions_spec.cc | 4 ++-- spec/compiler/build_tables/rule_can_be_blank_spec.cc | 4 ++-- spec/compiler/build_tables/rule_transitions_spec.cc | 2 +- spec/compiler/compile_examples.cc | 2 +- spec/compiler/compiler_spec_helper.h | 6 +++--- spec/compiler/compiler_specs.cc | 2 +- spec/compiler/prepare_grammar/expand_repeats_spec.cc | 4 ++-- spec/compiler/prepare_grammar/expand_tokens_spec.cc | 4 ++-- spec/compiler/prepare_grammar/extract_tokens_spec.cc | 4 ++-- spec/compiler/prepare_grammar/intern_symbols_spec.cc | 4 ++-- spec/compiler/prepare_grammar/parse_regex_spec.cc | 4 ++-- spec/compiler/rules/character_set_spec.cc | 2 +- spec/runtime/helpers/dummy_parser.c | 2 +- spec/runtime/helpers/read_test_entries.cc | 2 +- spec/runtime/helpers/spy_reader.cc | 2 +- spec/runtime/helpers/tree_helpers.cc | 2 +- spec/runtime/language_specs.cc | 6 +++--- spec/runtime/lr_parser_spec.cc | 8 ++++---- spec/runtime/node_position_spec.cc | 2 +- spec/runtime/parser_spec.cc | 4 ++-- spec/runtime/runtime_spec_helper.h | 2 +- spec/runtime/runtime_specs.cc | 2 +- spec/runtime/stack_spec.cc | 2 +- spec/runtime/tree_spec.cc | 2 +- tree_sitter.gyp | 8 ++++---- 32 files changed, 54 insertions(+), 54 deletions(-) diff --git a/spec/compiler/build_tables/build_parse_table_spec.cc b/spec/compiler/build_tables/build_parse_table_spec.cc index 295fa55a..5a8277fc 100644 --- a/spec/compiler/build_tables/build_parse_table_spec.cc +++ b/spec/compiler/build_tables/build_parse_table_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/build_parse_table.h" #include "compiler/parse_table.h" #include "compiler/prepared_grammar.h" diff --git a/spec/compiler/build_tables/conflict_manager_spec.cc b/spec/compiler/build_tables/conflict_manager_spec.cc index 7fa68955..358a7c51 100644 --- a/spec/compiler/build_tables/conflict_manager_spec.cc +++ b/spec/compiler/build_tables/conflict_manager_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/parse_conflict_manager.h" #include "compiler/build_tables/lex_conflict_manager.h" @@ -233,4 +233,4 @@ describe("resolving parse conflicts", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/first_set_spec.cc b/spec/compiler/build_tables/first_set_spec.cc index ee9ec8d5..187705cc 100644 --- a/spec/compiler/build_tables/first_set_spec.cc +++ b/spec/compiler/build_tables/first_set_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/build_tables/first_set.h" #include "compiler/rules/metadata.h" diff --git a/spec/compiler/build_tables/get_metadata_spec.cc b/spec/compiler/build_tables/get_metadata_spec.cc index 8129bd96..49e6c387 100644 --- a/spec/compiler/build_tables/get_metadata_spec.cc +++ b/spec/compiler/build_tables/get_metadata_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/rules/metadata.h" #include "compiler/build_tables/get_metadata.h" diff --git a/spec/compiler/build_tables/item_set_closure_spec.cc b/spec/compiler/build_tables/item_set_closure_spec.cc index de4ce5e0..3d867f09 100644 --- a/spec/compiler/build_tables/item_set_closure_spec.cc +++ b/spec/compiler/build_tables/item_set_closure_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/build_tables/item_set_closure.h" #include "compiler/build_tables/item_set_transitions.h" @@ -30,4 +30,4 @@ describe("computing closures of item sets", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/item_set_transitions_spec.cc b/spec/compiler/build_tables/item_set_transitions_spec.cc index 95c33414..04760266 100644 --- a/spec/compiler/build_tables/item_set_transitions_spec.cc +++ b/spec/compiler/build_tables/item_set_transitions_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/item_set_transitions.h" #include "compiler/prepared_grammar.h" @@ -49,4 +49,4 @@ describe("syntactic item set transitions", [&]() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/lex_item_spec.cc b/spec/compiler/build_tables/lex_item_spec.cc index 2098c62b..a97e734c 100644 --- a/spec/compiler/build_tables/lex_item_spec.cc +++ b/spec/compiler/build_tables/lex_item_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/item_set_transitions.h" #include "compiler/rules/metadata.h" #include "compiler/prepared_grammar.h" @@ -41,4 +41,4 @@ describe("lex items", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/merge_transitions_spec.cc b/spec/compiler/build_tables/merge_transitions_spec.cc index a5af3857..e6ca51fe 100644 --- a/spec/compiler/build_tables/merge_transitions_spec.cc +++ b/spec/compiler/build_tables/merge_transitions_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/merge_transitions.h" using namespace rules; @@ -85,4 +85,4 @@ describe("merging character set transitions", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/rule_can_be_blank_spec.cc b/spec/compiler/build_tables/rule_can_be_blank_spec.cc index bff7ae26..f5ed5029 100644 --- a/spec/compiler/build_tables/rule_can_be_blank_spec.cc +++ b/spec/compiler/build_tables/rule_can_be_blank_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/rule_can_be_blank.h" #include "compiler/rules/metadata.h" #include "compiler/prepared_grammar.h" @@ -77,4 +77,4 @@ describe("checking if rules can be blank", [&]() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/build_tables/rule_transitions_spec.cc b/spec/compiler/build_tables/rule_transitions_spec.cc index eab16713..35f3c9ab 100644 --- a/spec/compiler/build_tables/rule_transitions_spec.cc +++ b/spec/compiler/build_tables/rule_transitions_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/build_tables/rule_transitions.h" #include "compiler/rules/metadata.h" diff --git a/spec/compiler/compile_examples.cc b/spec/compiler/compile_examples.cc index 8b19fcaa..cad67b56 100644 --- a/spec/compiler/compile_examples.cc +++ b/spec/compiler/compile_examples.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include static string src_dir() { diff --git a/spec/compiler/compiler_spec_helper.h b/spec/compiler/compiler_spec_helper.h index 39b4be1f..3db0d1e1 100644 --- a/spec/compiler/compiler_spec_helper.h +++ b/spec/compiler/compiler_spec_helper.h @@ -2,9 +2,9 @@ #define __tree_sitter_compiler_spec_helper_h__ #include "bandit/bandit.h" -#include "helpers/stream_methods.h" -#include "helpers/equals_pointer.h" -#include "helpers/rule_helpers.h" +#include "compiler/helpers/stream_methods.h" +#include "compiler/helpers/equals_pointer.h" +#include "compiler/helpers/rule_helpers.h" #include "tree_sitter/compiler.h" using namespace tree_sitter; diff --git a/spec/compiler/compiler_specs.cc b/spec/compiler/compiler_specs.cc index 2fdde15a..e4bbd479 100644 --- a/spec/compiler/compiler_specs.cc +++ b/spec/compiler/compiler_specs.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" int main(int argc, char *argv[]) { const char *args[] = { diff --git a/spec/compiler/prepare_grammar/expand_repeats_spec.cc b/spec/compiler/prepare_grammar/expand_repeats_spec.cc index 833b49f0..d965f49b 100644 --- a/spec/compiler/prepare_grammar/expand_repeats_spec.cc +++ b/spec/compiler/prepare_grammar/expand_repeats_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/prepare_grammar/expand_repeats.h" @@ -93,4 +93,4 @@ describe("expanding repeat rules in a grammar", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/prepare_grammar/expand_tokens_spec.cc b/spec/compiler/prepare_grammar/expand_tokens_spec.cc index 4be64790..7bba1836 100644 --- a/spec/compiler/prepare_grammar/expand_tokens_spec.cc +++ b/spec/compiler/prepare_grammar/expand_tokens_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/prepare_grammar/expand_tokens.h" @@ -60,4 +60,4 @@ describe("expanding token rules", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/prepare_grammar/extract_tokens_spec.cc b/spec/compiler/prepare_grammar/extract_tokens_spec.cc index 7d6c9342..0fd858b9 100644 --- a/spec/compiler/prepare_grammar/extract_tokens_spec.cc +++ b/spec/compiler/prepare_grammar/extract_tokens_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/prepare_grammar/extract_tokens.h" @@ -158,4 +158,4 @@ describe("extracting tokens from a grammar", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/prepare_grammar/intern_symbols_spec.cc b/spec/compiler/prepare_grammar/intern_symbols_spec.cc index dd7ccf66..61196f08 100644 --- a/spec/compiler/prepare_grammar/intern_symbols_spec.cc +++ b/spec/compiler/prepare_grammar/intern_symbols_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepared_grammar.h" #include "compiler/prepare_grammar/intern_symbols.h" #include "compiler/rules/named_symbol.h" @@ -55,4 +55,4 @@ describe("interning symbols in a grammar", []() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/prepare_grammar/parse_regex_spec.cc b/spec/compiler/prepare_grammar/parse_regex_spec.cc index e0e689a8..1cac4742 100644 --- a/spec/compiler/prepare_grammar/parse_regex_spec.cc +++ b/spec/compiler/prepare_grammar/parse_regex_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/prepare_grammar/parse_regex.h" START_TEST @@ -218,4 +218,4 @@ describe("parsing regex patterns", []() { } }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/compiler/rules/character_set_spec.cc b/spec/compiler/rules/character_set_spec.cc index 54c1b1b9..60a5db05 100644 --- a/spec/compiler/rules/character_set_spec.cc +++ b/spec/compiler/rules/character_set_spec.cc @@ -1,4 +1,4 @@ -#include "compiler_spec_helper.h" +#include "compiler/compiler_spec_helper.h" #include "compiler/rules/character_set.h" using namespace rules; diff --git a/spec/runtime/helpers/dummy_parser.c b/spec/runtime/helpers/dummy_parser.c index 1f1654f6..ab6ad770 100644 --- a/spec/runtime/helpers/dummy_parser.c +++ b/spec/runtime/helpers/dummy_parser.c @@ -1,4 +1,4 @@ -#include "helpers/dummy_parser.h" +#include "runtime/helpers/dummy_parser.h" const ts_parse_action parse_table[3][5] = { [0] = { diff --git a/spec/runtime/helpers/read_test_entries.cc b/spec/runtime/helpers/read_test_entries.cc index 02bf690d..5c4af0e4 100644 --- a/spec/runtime/helpers/read_test_entries.cc +++ b/spec/runtime/helpers/read_test_entries.cc @@ -1,4 +1,4 @@ -#include "helpers/read_test_entries.h" +#include "runtime/helpers/read_test_entries.h" #include #include #include diff --git a/spec/runtime/helpers/spy_reader.cc b/spec/runtime/helpers/spy_reader.cc index df79c6c3..22dd6f58 100644 --- a/spec/runtime/helpers/spy_reader.cc +++ b/spec/runtime/helpers/spy_reader.cc @@ -1,4 +1,4 @@ -#include "helpers/spy_reader.h" +#include "runtime/helpers/spy_reader.h" #include using std::string; diff --git a/spec/runtime/helpers/tree_helpers.cc b/spec/runtime/helpers/tree_helpers.cc index 675b668b..42506e50 100644 --- a/spec/runtime/helpers/tree_helpers.cc +++ b/spec/runtime/helpers/tree_helpers.cc @@ -1,4 +1,4 @@ -#include "helpers/tree_helpers.h" +#include "runtime/helpers/tree_helpers.h" ts_tree ** tree_array(std::vector trees) { ts_tree ** result = (ts_tree **)calloc(trees.size(), sizeof(ts_tree *)); diff --git a/spec/runtime/language_specs.cc b/spec/runtime/language_specs.cc index f7968900..8568e390 100644 --- a/spec/runtime/language_specs.cc +++ b/spec/runtime/language_specs.cc @@ -1,5 +1,5 @@ -#include "runtime_spec_helper.h" -#include "helpers/read_test_entries.h" +#include "runtime/runtime_spec_helper.h" +#include "runtime/helpers/read_test_entries.h" extern "C" ts_parser ts_parser_javascript(); extern "C" ts_parser ts_parser_json(); @@ -42,4 +42,4 @@ describe("Languages", [&]() { run_tests_for_language("golang", ts_parser_golang); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/runtime/lr_parser_spec.cc b/spec/runtime/lr_parser_spec.cc index 52701148..f1efe9c5 100644 --- a/spec/runtime/lr_parser_spec.cc +++ b/spec/runtime/lr_parser_spec.cc @@ -1,6 +1,6 @@ -#include "runtime_spec_helper.h" -#include "helpers/spy_reader.h" -#include "helpers/dummy_parser.h" +#include "runtime/runtime_spec_helper.h" +#include "runtime/helpers/spy_reader.h" +#include "runtime/helpers/dummy_parser.h" #include "tree_sitter/parser/lr_parser.h" ts_tree *lex_fn_node_to_return; @@ -73,4 +73,4 @@ describe("LR Parsers", [&]() { }); }); -END_TEST \ No newline at end of file +END_TEST diff --git a/spec/runtime/node_position_spec.cc b/spec/runtime/node_position_spec.cc index aa605c1f..44bed2d7 100644 --- a/spec/runtime/node_position_spec.cc +++ b/spec/runtime/node_position_spec.cc @@ -1,4 +1,4 @@ -#include "runtime_spec_helper.h" +#include "runtime/runtime_spec_helper.h" extern "C" ts_parser ts_parser_json(); diff --git a/spec/runtime/parser_spec.cc b/spec/runtime/parser_spec.cc index 300c2a4a..b67914c7 100644 --- a/spec/runtime/parser_spec.cc +++ b/spec/runtime/parser_spec.cc @@ -1,5 +1,5 @@ -#include "runtime_spec_helper.h" -#include "helpers/spy_reader.h" +#include "runtime/runtime_spec_helper.h" +#include "runtime/helpers/spy_reader.h" extern "C" ts_parser ts_parser_json(); diff --git a/spec/runtime/runtime_spec_helper.h b/spec/runtime/runtime_spec_helper.h index a62e5b59..dbdd743c 100644 --- a/spec/runtime/runtime_spec_helper.h +++ b/spec/runtime/runtime_spec_helper.h @@ -3,7 +3,7 @@ #include "bandit/bandit.h" #include "tree_sitter/runtime.h" -#include "helpers/tree_helpers.h" +#include "runtime/helpers/tree_helpers.h" using namespace std; using namespace bandit; diff --git a/spec/runtime/runtime_specs.cc b/spec/runtime/runtime_specs.cc index 586fac0c..b5f5acb5 100644 --- a/spec/runtime/runtime_specs.cc +++ b/spec/runtime/runtime_specs.cc @@ -1,4 +1,4 @@ -#include "runtime_spec_helper.h" +#include "runtime/runtime_spec_helper.h" int main(int argc, char *argv[]) { const char *args[] = { diff --git a/spec/runtime/stack_spec.cc b/spec/runtime/stack_spec.cc index 4b2b9625..6149765d 100644 --- a/spec/runtime/stack_spec.cc +++ b/spec/runtime/stack_spec.cc @@ -1,4 +1,4 @@ -#include "runtime_spec_helper.h" +#include "runtime/runtime_spec_helper.h" #include "tree_sitter/parser/stack.h" START_TEST diff --git a/spec/runtime/tree_spec.cc b/spec/runtime/tree_spec.cc index 872bcc09..b7bcb3ee 100644 --- a/spec/runtime/tree_spec.cc +++ b/spec/runtime/tree_spec.cc @@ -1,4 +1,4 @@ -#include "runtime_spec_helper.h" +#include "runtime/runtime_spec_helper.h" START_TEST diff --git a/tree_sitter.gyp b/tree_sitter.gyp index 1e989769..39c242a5 100644 --- a/tree_sitter.gyp +++ b/tree_sitter.gyp @@ -44,9 +44,9 @@ 'dependencies': ['tree_sitter'], 'include_dirs': [ 'src', - 'externals/bandit', 'examples', - 'spec/compiler', + 'spec', + 'externals/bandit', ], 'sources': [ '