diff --git a/lib/src/array.h b/lib/src/array.h index 60cfc800..3f5b6b29 100644 --- a/lib/src/array.h +++ b/lib/src/array.h @@ -10,7 +10,7 @@ extern "C" { #include #include #include -#include "runtime/alloc.h" +#include "./alloc.h" #define Array(T) \ struct { \ diff --git a/lib/src/get_changed_ranges.c b/lib/src/get_changed_ranges.c index 900d36ed..da39dd13 100644 --- a/lib/src/get_changed_ranges.c +++ b/lib/src/get_changed_ranges.c @@ -1,8 +1,8 @@ -#include "runtime/get_changed_ranges.h" -#include "runtime/subtree.h" -#include "runtime/language.h" -#include "runtime/error_costs.h" -#include "runtime/tree_cursor.h" +#include "./get_changed_ranges.h" +#include "./subtree.h" +#include "./language.h" +#include "./error_costs.h" +#include "./tree_cursor.h" #include // #define DEBUG_GET_CHANGED_RANGES diff --git a/lib/src/get_changed_ranges.h b/lib/src/get_changed_ranges.h index e7fcead1..2764b55f 100644 --- a/lib/src/get_changed_ranges.h +++ b/lib/src/get_changed_ranges.h @@ -5,8 +5,8 @@ extern "C" { #endif -#include "runtime/tree_cursor.h" -#include "runtime/subtree.h" +#include "./tree_cursor.h" +#include "./subtree.h" typedef Array(TSRange) TSRangeArray; diff --git a/lib/src/language.c b/lib/src/language.c index 0fb03b6c..9541bba2 100644 --- a/lib/src/language.c +++ b/lib/src/language.c @@ -1,6 +1,6 @@ -#include "runtime/language.h" -#include "runtime/subtree.h" -#include "runtime/error_costs.h" +#include "./language.h" +#include "./subtree.h" +#include "./error_costs.h" #include void ts_language_table_entry(const TSLanguage *self, TSStateId state, diff --git a/lib/src/language.h b/lib/src/language.h index 8386a054..c8e5e8a1 100644 --- a/lib/src/language.h +++ b/lib/src/language.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include "runtime/subtree.h" +#include "./subtree.h" #include "tree_sitter/parser.h" #define ts_builtin_sym_error_repeat (ts_builtin_sym_error - 1) diff --git a/lib/src/length.h b/lib/src/length.h index 8dd1715e..db325f7a 100644 --- a/lib/src/length.h +++ b/lib/src/length.h @@ -3,7 +3,7 @@ #include #include -#include "runtime/point.h" +#include "./point.h" #include "tree_sitter/runtime.h" typedef struct { diff --git a/lib/src/lexer.c b/lib/src/lexer.c index d2b9ad70..b33da344 100644 --- a/lib/src/lexer.c +++ b/lib/src/lexer.c @@ -1,8 +1,8 @@ #include -#include "runtime/lexer.h" -#include "runtime/subtree.h" -#include "runtime/length.h" -#include "runtime/utf16.h" +#include "./lexer.h" +#include "./subtree.h" +#include "./length.h" +#include "./utf16.h" #include "utf8proc.h" #define LOG(...) \ diff --git a/lib/src/lexer.h b/lib/src/lexer.h index 491c2da1..327350f6 100644 --- a/lib/src/lexer.h +++ b/lib/src/lexer.h @@ -5,8 +5,8 @@ extern "C" { #endif -#include "runtime/length.h" -#include "runtime/subtree.h" +#include "./length.h" +#include "./subtree.h" #include "tree_sitter/runtime.h" #include "tree_sitter/parser.h" diff --git a/lib/src/node.c b/lib/src/node.c index c1763261..eb4a3121 100644 --- a/lib/src/node.c +++ b/lib/src/node.c @@ -1,7 +1,7 @@ #include -#include "runtime/subtree.h" -#include "runtime/tree.h" -#include "runtime/language.h" +#include "./subtree.h" +#include "./tree.h" +#include "./language.h" typedef struct { Subtree parent; diff --git a/lib/src/parser.c b/lib/src/parser.c index c7050ce5..ef7f612d 100644 --- a/lib/src/parser.c +++ b/lib/src/parser.c @@ -3,18 +3,18 @@ #include #include #include "tree_sitter/runtime.h" -#include "runtime/subtree.h" -#include "runtime/lexer.h" -#include "runtime/length.h" -#include "runtime/array.h" -#include "runtime/language.h" -#include "runtime/alloc.h" -#include "runtime/stack.h" -#include "runtime/reusable_node.h" -#include "runtime/reduce_action.h" -#include "runtime/error_costs.h" -#include "runtime/get_changed_ranges.h" -#include "runtime/tree.h" +#include "./subtree.h" +#include "./lexer.h" +#include "./length.h" +#include "./array.h" +#include "./language.h" +#include "./alloc.h" +#include "./stack.h" +#include "./reusable_node.h" +#include "./reduce_action.h" +#include "./error_costs.h" +#include "./get_changed_ranges.h" +#include "./tree.h" #define LOG(...) \ if (self->lexer.logger.log || self->dot_graph_file) { \ diff --git a/lib/src/reduce_action.h b/lib/src/reduce_action.h index 75267c3f..91835c39 100644 --- a/lib/src/reduce_action.h +++ b/lib/src/reduce_action.h @@ -5,7 +5,7 @@ extern "C" { #endif -#include "runtime/array.h" +#include "./array.h" #include "tree_sitter/runtime.h" typedef struct { diff --git a/lib/src/reusable_node.h b/lib/src/reusable_node.h index cb9cea58..ab91cb36 100644 --- a/lib/src/reusable_node.h +++ b/lib/src/reusable_node.h @@ -1,4 +1,4 @@ -#include "runtime/subtree.h" +#include "./subtree.h" typedef struct { Subtree tree; diff --git a/lib/src/runtime.c b/lib/src/runtime.c index 51455a8b..b29f5214 100644 --- a/lib/src/runtime.c +++ b/lib/src/runtime.c @@ -6,14 +6,14 @@ // - include // - externals/utf8proc -#include "runtime/get_changed_ranges.c" -#include "runtime/language.c" -#include "runtime/lexer.c" -#include "runtime/node.c" -#include "runtime/parser.c" -#include "runtime/stack.c" -#include "runtime/subtree.c" -#include "runtime/tree_cursor.c" -#include "runtime/tree.c" -#include "runtime/utf16.c" +#include "./get_changed_ranges.c" +#include "./language.c" +#include "./lexer.c" +#include "./node.c" +#include "./parser.c" +#include "./stack.c" +#include "./subtree.c" +#include "./tree_cursor.c" +#include "./tree.c" +#include "./utf16.c" #include "utf8proc.c" diff --git a/lib/src/stack.c b/lib/src/stack.c index cc434e38..e3a1f22d 100644 --- a/lib/src/stack.c +++ b/lib/src/stack.c @@ -1,9 +1,9 @@ -#include "runtime/alloc.h" -#include "runtime/language.h" -#include "runtime/subtree.h" -#include "runtime/array.h" -#include "runtime/stack.h" -#include "runtime/length.h" +#include "./alloc.h" +#include "./language.h" +#include "./subtree.h" +#include "./array.h" +#include "./stack.h" +#include "./length.h" #include #include diff --git a/lib/src/stack.h b/lib/src/stack.h index 272bb4ee..d476d763 100644 --- a/lib/src/stack.h +++ b/lib/src/stack.h @@ -5,9 +5,9 @@ extern "C" { #endif -#include "runtime/array.h" -#include "runtime/subtree.h" -#include "runtime/error_costs.h" +#include "./array.h" +#include "./subtree.h" +#include "./error_costs.h" #include typedef struct Stack Stack; diff --git a/lib/src/subtree.c b/lib/src/subtree.c index eb7e0530..48c8cff3 100644 --- a/lib/src/subtree.c +++ b/lib/src/subtree.c @@ -4,12 +4,12 @@ #include #include #include -#include "runtime/alloc.h" -#include "runtime/atomic.h" -#include "runtime/subtree.h" -#include "runtime/length.h" -#include "runtime/language.h" -#include "runtime/error_costs.h" +#include "./alloc.h" +#include "./atomic.h" +#include "./subtree.h" +#include "./length.h" +#include "./language.h" +#include "./error_costs.h" #include typedef struct { diff --git a/lib/src/subtree.h b/lib/src/subtree.h index de3ddc16..cc5c79aa 100644 --- a/lib/src/subtree.h +++ b/lib/src/subtree.h @@ -7,9 +7,9 @@ extern "C" { #include #include -#include "runtime/length.h" -#include "runtime/array.h" -#include "runtime/error_costs.h" +#include "./length.h" +#include "./array.h" +#include "./error_costs.h" #include "tree_sitter/runtime.h" #include "tree_sitter/parser.h" diff --git a/lib/src/tree.c b/lib/src/tree.c index e5122cc1..b729c8c7 100644 --- a/lib/src/tree.c +++ b/lib/src/tree.c @@ -1,9 +1,9 @@ #include "tree_sitter/runtime.h" -#include "runtime/array.h" -#include "runtime/get_changed_ranges.h" -#include "runtime/subtree.h" -#include "runtime/tree_cursor.h" -#include "runtime/tree.h" +#include "./array.h" +#include "./get_changed_ranges.h" +#include "./subtree.h" +#include "./tree_cursor.h" +#include "./tree.h" static const unsigned PARENT_CACHE_CAPACITY = 32; diff --git a/lib/src/tree_cursor.c b/lib/src/tree_cursor.c index 9fce48be..d352c32b 100644 --- a/lib/src/tree_cursor.c +++ b/lib/src/tree_cursor.c @@ -1,8 +1,8 @@ #include "tree_sitter/runtime.h" -#include "runtime/alloc.h" -#include "runtime/tree_cursor.h" -#include "runtime/language.h" -#include "runtime/tree.h" +#include "./alloc.h" +#include "./tree_cursor.h" +#include "./language.h" +#include "./tree.h" typedef struct { Subtree parent; diff --git a/lib/src/tree_cursor.h b/lib/src/tree_cursor.h index 84300b21..6e46b7dd 100644 --- a/lib/src/tree_cursor.h +++ b/lib/src/tree_cursor.h @@ -1,7 +1,7 @@ #ifndef RUNTIME_TREE_CURSOR_H_ #define RUNTIME_TREE_CURSOR_H_ -#include "runtime/subtree.h" +#include "./subtree.h" typedef struct { const Subtree *subtree; diff --git a/lib/src/utf16.c b/lib/src/utf16.c index adb82edf..3956c01c 100644 --- a/lib/src/utf16.c +++ b/lib/src/utf16.c @@ -1,4 +1,4 @@ -#include "runtime/utf16.h" +#include "./utf16.h" utf8proc_ssize_t utf16_iterate( const utf8proc_uint8_t *string, diff --git a/script/build-runtime b/script/build-runtime index 9e09b836..7b2e99f2 100755 --- a/script/build-runtime +++ b/script/build-runtime @@ -11,11 +11,11 @@ ${CC} \ -c \ -O3 \ -std=c99 \ - -I src \ - -I include \ - -I externals/utf8proc \ - src/runtime/runtime.c \ - -o runtime.o + -I lib/src \ + -I lib/include \ + -I lib/utf8proc \ + lib/src/runtime.c \ + -o tree-sitter.o -ar rcs libruntime.a runtime.o -rm runtime.o +ar rcs libtree-sitter.a tree-sitter.o +rm tree-sitter.o