Ruby: Move extractor into shared crate

This makes it possible for different languages to share this extractor.
This commit is contained in:
Harry Maclean
2023-03-16 13:08:15 +13:00
parent 71c37dba32
commit c4a7389873
17 changed files with 23 additions and 3 deletions

Binary file not shown.

View File

@@ -22,3 +22,4 @@ lazy_static = "1.4.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
chrono = { version = "0.4.19", features = ["serde"] }
codeql-extractor = { path = "../../shared/extractor" }

View File

@@ -11,7 +11,7 @@ use std::io::BufRead;
use std::path::{Path, PathBuf};
use tree_sitter::{Language, Parser, Range};
use ruby_extractor::{diagnostics, extractor, file_paths, node_types, trap};
use codeql_extractor::{diagnostics, extractor, file_paths, node_types, trap};
/**
* Gets the number of threads the extractor should use, by reading the

View File

@@ -6,8 +6,8 @@ use std::io::LineWriter;
use std::io::Write;
use std::path::PathBuf;
use ruby_extractor::generator::{dbscheme, language::Language, ql, ql_gen};
use ruby_extractor::node_types;
use codeql_extractor::generator::{dbscheme, language::Language, ql, ql_gen};
use codeql_extractor::node_types;
/// Given the name of the parent node, and its field information, returns a pair,
/// the first of which is the field's type. The second is an optional dbscheme

2
shared/extractor/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target
/Cargo.lock

View File

@@ -0,0 +1,17 @@
[package]
name = "codeql-extractor"
version = "0.1.0"
edition = "2021"
authors = ["GitHub"]
[dependencies]
flate2 = "1.0"
tree-sitter = "0.20"
tracing = "0.1"
rayon = "1.5.0"
regex = "1.7.1"
encoding = "0.2"
lazy_static = "1.4.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
chrono = { version = "0.4.19", features = ["serde"] }