Skip to content

feat(multicore): create parser struct for each function. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Parse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ type mt = Run.matcher_token
external create_parser :
unit -> Tree_sitter_API.ts_parser = "octs_create_parser_bash"

let ts_parser = create_parser ()

let parse_source_string ?src_file contents =
let ts_parser = create_parser () in
Tree_sitter_parsing.parse_source_string ?src_file ts_parser contents

let parse_source_file src_file =
let ts_parser = create_parser () in
Tree_sitter_parsing.parse_source_file ts_parser src_file

let extras = [
Expand Down
3 changes: 0 additions & 3 deletions lib/Parse.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ val file :
(** Whether to print debugging information. Default: false. *)
val debug : bool ref

(** The original tree-sitter parser. *)
val ts_parser : Tree_sitter_bindings.Tree_sitter_API.ts_parser

(** Parse a program into a tree-sitter CST. *)
val parse_source_string :
?src_file:string -> string -> Tree_sitter_run.Tree_sitter_parsing.t
Expand Down