Skip to content

Commit

Permalink
Removing debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
notdanilo committed Aug 30, 2024
1 parent be3813b commit f176c93
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion ecosystem/python/parser/src/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub(crate) struct SubPath<'a>(pub &'a std::path::Path);
impl Parser<File<'_>> for PythonParser {
type Output = Module;
fn parse(&self, File(input): File<'_>, config: &ParserConfig) -> Result<Self::Output> {
println!("Parsing file: {}", input.display());
let content = std::fs::read_to_string(input)?;
let module = ModuleParser.parse(content.as_str(), config)?;
let mut module = self.parse(module, config)?;
Expand Down
2 changes: 0 additions & 2 deletions ecosystem/python/parser/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ impl PythonParser {
// This line replaces "-" with "_" in the file name
let input = input.with_file_name(input.file_name().unwrap().to_string_lossy().replace('-', "_").as_str().trim());
let input = input.as_path();
println!("Parsing library: {}", input.display());
let identifier = self.identifier_parser.parse(input, config)?;
let metadata = self.metadata_parser.parse(input, config)?;
let root_module = self.parse(SubPath(input), config)?;
Expand All @@ -50,7 +49,6 @@ impl PythonParser {
impl Parser<&std::path::Path> for PythonParser {
type Output = Registry;
fn parse(&self, input: &std::path::Path, config: &ParserConfig) -> Result<Self::Output> {
println!("Parsing: {}", input.display());
let mut registry = Registry::new();
let library = self.parse_library(input, config)?;
for dependency in library.metadata.dependencies.iter().filter(|dependency| dependency.feature.is_none()) { // TODO: We need to support features.
Expand Down
2 changes: 1 addition & 1 deletion ecosystem/python/parser/src/scope/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl PythonParser {
if let Stmt::ClassDef(class) = statement {
match self.type_definition_parser.parse(statements.sub(class.clone()), config) {
Ok(type_definition) => types.push(type_definition),
Err(error) => println!("Failed to parse type definition: {:?}", error)
Err(error) => todo!("Failed to parse type definition: {:?}", error)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion ecosystem/python/parser/src/types/type_/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl Validator for TypeValidator {
fn validate(&self, type_: &mut Type, config: &ParserConfig) -> Result<()> {
let name = type_.path.last().identifier.name.as_str();
if config.get(Path::from("ligen::python::as-opaque").join(name)).is_some() {
println!("{}", type_.path);
*type_ = Type::opaque();
}
Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pub(crate) enum IntermediaryAttribute {

impl syn::parse::Parse for IntermediaryAttribute {
fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
println!("{}", input);
if input.peek(syn::Lit) {
input.parse().map(IntermediaryAttribute::Lit)
} else {
Expand Down
3 changes: 0 additions & 3 deletions ligen/parser/src/parser/universal/attributes/attribute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl<T: LiteralParser> Parser<syn::ItemMacro> for AttributeParser<T> {
impl<T: LiteralParser> Parser<syn::MetaList> for AttributeParser<T> {
type Output = Attribute;
fn parse(&self, meta_list: syn::MetaList, config: &ParserConfig) -> Result<Self::Output> {
println!("4");
let path = PathParser::default().parse(meta_list.path.clone(), config)?;
let inner = meta_list.tokens.into_iter().map(|token| token.to_string()).collect::<Vec<_>>().join("");
let attributes = AttributesParser::<T>::default().parse(inner.as_str(), config)?;
Expand Down Expand Up @@ -126,7 +125,6 @@ impl<T: LiteralParser> Parser<syn::MetaNameValue> for AttributeParser<T> {
impl<T: LiteralParser> Parser<syn::Meta> for AttributeParser<T> {
type Output = Attribute;
fn parse(&self, meta: syn::Meta, config: &ParserConfig) -> Result<Self::Output> {
println!("3");
match meta {
syn::Meta::Path(path) => self.parse(path, config),
syn::Meta::List(list) => self.parse(list, config),
Expand All @@ -152,7 +150,6 @@ impl<T: LiteralParser> Parser<String> for AttributeParser<T> {
impl<T: LiteralParser> Parser<IntermediaryAttribute> for AttributeParser<T> {
type Output = Attribute;
fn parse(&self, input: IntermediaryAttribute, config: &ParserConfig) -> Result<Self::Output> {
println!("2", );
match input {
IntermediaryAttribute::Meta(meta) => self.parse(meta, config),
IntermediaryAttribute::Lit(lit) => self.parse(lit, config),
Expand Down
2 changes: 0 additions & 2 deletions ligen/parser/src/parser/universal/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ impl<L: LiteralParser> Parser<&str> for AttributesParser<L>
{
type Output = Attributes;
fn parse(&self, input: &str, config: &ParserConfig) -> Result<Self::Output> {
println!("{}", input);
syn::parse_str::<syn2::punctuated::Punctuated<IntermediaryAttribute, syn::token::Comma>>(input)
.map_err(|e| Error::Message(format!("Failed to parse attributes: {}. Input: {}", e, input)))
.and_then(|input| self.parse(input.0, config))
Expand All @@ -51,7 +50,6 @@ impl<L: LiteralParser> Parser<syn::punctuated::Punctuated<IntermediaryAttribute,
{
type Output = Attributes;
fn parse(&self, input: syn::punctuated::Punctuated<IntermediaryAttribute, syn::token::Comma>, config: &ParserConfig) -> Result<Self::Output> {
println!("??");
let mut attributes = Vec::new();
for attribute in input {
attributes.push(self.attribute_parser.parse(attribute, config)?);
Expand Down
3 changes: 1 addition & 2 deletions tools/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ fn main() -> Result<()> {
panic!("Parser not found.");
};
let config = parser.config();
let registry = parser.parse(args.input.as_path(), &config)?;
println!("{:#?}", registry);
let _registry = parser.parse(args.input.as_path(), &config)?;
// for library in registry.libraries.iter() {
// LibraryGenerator::default().generate(&library, PathBuf::from(&args.output).as_path())?;
// }
Expand Down

0 comments on commit f176c93

Please sign in to comment.