Skip to content

Conversation

@windelbouwman
Copy link
Contributor

No description provided.


fn main() {
env_logger::init();
let app = App::new("RustPython")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since RustPython is the name of the whole project and, presumably, its interpreter as a stand-alone application – shouldn’t this be called something else (or at least – more specific)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, copy paste error, thanks!

res.extend(x);
}

if metadata.is_file() && path.extension().map(|s| s.to_str().unwrap()) == Some("py") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if metadata.is_file() && path.extension().map(|s| s.to_str().unwrap()) == Some("py") {
if metadata.is_file() && path.extension().and_then(|s| s.to_str()) == Some("py") {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

if folder.exists() && folder.is_dir() {
println!("Parsing folder of python code: {:?}", folder);
let res = parse_folder(&folder).unwrap();
println!("Processed {:?} files", res.len());
Copy link
Member

@coolreader18 coolreader18 Jul 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it print the parsed files or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some ideas for metrics:

  • parsed lines per second
  • print the amount of functions / classes

For now, I just use it to try and scan my cpython lib folder

@windelbouwman windelbouwman merged commit a02e131 into master Jul 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants