Explorar o código

add python parser

Alexandre Janniaux %!s(int64=5) %!d(string=hai) anos
pai
achega
369d56d479
Modificáronse 2 ficheiros con 11 adicións e 1 borrados
  1. 1 0
      Cargo.toml
  2. 10 1
      src/main.rs

+ 1 - 0
Cargo.toml

@@ -7,3 +7,4 @@ edition = "2018"
 # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
 
 [dependencies]
+python-parser = "0.1"

+ 10 - 1
src/main.rs

@@ -1,3 +1,12 @@
+use python_parser::ast::*;
+use std::fs;
+
 fn main() {
-    println!("Hello, world!");
+
+    let source = fs::read_to_string("guessit/guessit/rules/properties/episodes.py")
+        .unwrap();
+
+    let ast = python_parser::file_input(python_parser::make_strspan(&source));
+
+    println!("{:#?}", ast);
 }