Skip to content

Commit f53c313

Browse files
committed
Ruby: Fix imports in extractor
1 parent 15bd825 commit f53c313

File tree

9 files changed

+21
-40
lines changed

9 files changed

+21
-40
lines changed

ruby/extractor/Cargo.lock

Lines changed: 0 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby/extractor/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ edition = "2018"
88

99
[dependencies]
1010
flate2 = "1.0"
11-
node-types = { path = "../node-types" }
1211
tree-sitter = "0.20"
1312
tree-sitter-embedded-template = { git = "https://github.com/tree-sitter/tree-sitter-embedded-template.git", rev = "203f7bd3c1bbfbd98fc19add4b8fcb213c059205" }
1413
tree-sitter-ruby = { git = "https://github.com/tree-sitter/tree-sitter-ruby.git", rev = "206c7077164372c596ffa8eaadb9435c28941364" }

ruby/extractor/src/bin/generator.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
mod dbscheme;
2-
mod language;
3-
mod ql;
4-
mod ql_gen;
5-
61
use clap::arg;
7-
use language::Language;
82
use std::collections::BTreeMap as Map;
93
use std::collections::BTreeSet as Set;
104
use std::fs::File;
115
use std::io::LineWriter;
126
use std::io::Write;
137
use std::path::PathBuf;
148

9+
use ruby_extractor::generator::{dbscheme, language::Language, ql, ql_gen};
10+
use ruby_extractor::node_types;
11+
1512
/// Given the name of the parent node, and its field information, returns a pair,
1613
/// the first of which is the field's type. The second is an optional dbscheme
1714
/// entry that should be added.

ruby/extractor/src/extractor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::diagnostics;
22
use crate::file_paths;
33
use crate::trap;
4-
use node_types::{EntryKind, Field, NodeTypeMap, Storage, TypeName};
4+
use crate::node_types::{self, EntryKind, Field, NodeTypeMap, Storage, TypeName};
55
use std::collections::BTreeMap as Map;
66
use std::collections::BTreeSet as Set;
77
use std::fmt;

ruby/extractor/src/generator/dbscheme.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
use crate::ql;
21
use std::collections::BTreeSet as Set;
32
use std::fmt;
3+
4+
use crate::generator::ql;
5+
46
/// Represents a distinct entry in the database schema.
57
pub enum Entry<'a> {
68
/// An entry defining a database table.

ruby/extractor/src/generator/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pub mod dbscheme;
2+
pub mod language;
3+
pub mod ql;
4+
pub mod ql_gen;

ruby/extractor/src/generator/ql_gen.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::ql;
21
use std::collections::BTreeSet;
32

3+
use crate::{node_types, generator::ql};
4+
45
/// Creates the hard-coded `AstNode` class that acts as a supertype of all
56
/// classes we generate.
67
pub fn create_ast_node_class<'a>(ast_node: &'a str, node_info_table: &'a str) -> ql::Class<'a> {

ruby/extractor/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pub mod generator;
2+
pub mod node_types;
3+
pub mod trap;
4+
pub mod diagnostics;
5+
pub mod extractor;
6+
pub mod file_paths;

ruby/extractor/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
mod diagnostics;
2-
mod extractor;
3-
mod file_paths;
4-
mod trap;
5-
61
#[macro_use]
72
extern crate lazy_static;
83
extern crate num_cpus;
@@ -16,6 +11,8 @@ use std::io::BufRead;
1611
use std::path::{Path, PathBuf};
1712
use tree_sitter::{Language, Parser, Range};
1813

14+
use ruby_extractor::{diagnostics, extractor, file_paths, trap, node_types};
15+
1916
/**
2017
* Gets the number of threads the extractor should use, by reading the
2118
* CODEQL_THREADS environment variable and using it as described in the

0 commit comments

Comments
 (0)