Skip to content

Commit

Permalink
Replace symlinks (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
314eter authored Jun 30, 2024
1 parent 0e3a2ef commit cd95a67
Show file tree
Hide file tree
Showing 28 changed files with 1,179 additions and 36 deletions.
5 changes: 3 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

grammars/ocaml/src/*.json linguist-generated
grammars/ocaml/src/parser.c linguist-generated
grammars/ocaml/src/tree_sitter/* linguist-vendored

grammars/interface/src/*.json linguist-generated
grammars/interface/src/parser.c linguist-generated
grammars/interface/src/tree_sitter/* linguist-vendored

grammars/type/src/*.json linguist-generated
grammars/type/src/parser.c linguist-generated

include/tree_sitter/* linguist-vendored
grammars/type/src/tree_sitter/* linguist-vendored

bindings/** linguist-generated
binding.gyp linguist-generated
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
- name: Test
run: npm run test-binding


test-rust:
name: Test Rust binding
runs-on: ${{matrix.os}}
Expand Down
15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ autoexamples = false

build = "bindings/rust/build.rs"
include = [
"bindings/rust/*",
"bindings/rust",
"common",
"grammars/ocaml/grammar.js",
"grammars/ocaml/src/*.c",
"grammars/ocaml/src/*.json",
"grammars/ocaml/src",
"grammars/interface/grammar.js",
"grammars/interface/src/*.c",
"grammars/interface/src/*.json",
"grammars/interface/src",
"grammars/type/grammar.js",
"grammars/type/src/*.c",
"grammars/type/src/*.json",
"include/*",
"queries/*"
"grammars/type/src",
"queries"
]

[lib]
Expand Down
4 changes: 2 additions & 2 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Package.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion binding.gyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/go/binding_interface.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/go/binding_ocaml.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindings/go/binding_type.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindings/rust/build.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion grammars/interface/src/scanner.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../../../include/scanner.h"
#include "../../../common/scanner.h"

void *tree_sitter_ocaml_interface_external_scanner_create() { return create(); }

Expand Down
1 change: 0 additions & 1 deletion grammars/interface/src/tree_sitter

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion grammars/ocaml/src/scanner.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../../../include/scanner.h"
#include "../../../common/scanner.h"

void *tree_sitter_ocaml_external_scanner_create() { return create(); }

Expand Down
1 change: 0 additions & 1 deletion grammars/ocaml/src/tree_sitter

This file was deleted.

54 changes: 54 additions & 0 deletions grammars/ocaml/src/tree_sitter/alloc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#ifndef TREE_SITTER_ALLOC_H_
#define TREE_SITTER_ALLOC_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>

// Allow clients to override allocation functions
#ifdef TREE_SITTER_REUSE_ALLOCATOR

extern void *(*ts_current_malloc)(size_t);
extern void *(*ts_current_calloc)(size_t, size_t);
extern void *(*ts_current_realloc)(void *, size_t);
extern void (*ts_current_free)(void *);

#ifndef ts_malloc
#define ts_malloc ts_current_malloc
#endif
#ifndef ts_calloc
#define ts_calloc ts_current_calloc
#endif
#ifndef ts_realloc
#define ts_realloc ts_current_realloc
#endif
#ifndef ts_free
#define ts_free ts_current_free
#endif

#else

#ifndef ts_malloc
#define ts_malloc malloc
#endif
#ifndef ts_calloc
#define ts_calloc calloc
#endif
#ifndef ts_realloc
#define ts_realloc realloc
#endif
#ifndef ts_free
#define ts_free free
#endif

#endif

#ifdef __cplusplus
}
#endif

#endif // TREE_SITTER_ALLOC_H_
Loading

0 comments on commit cd95a67

Please sign in to comment.