Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: final version ast extractor #6

Merged
merged 3 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added libs/ast-extractor/README.md
Empty file.
Empty file.
16 changes: 16 additions & 0 deletions libs/ast-extractor/ast_extractor/ast.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import json
import subprocess

def filepath_vyper_to_ast(file_path):
try:
result = subprocess.run(
['vyper', '-f', 'ast', file_path],
capture_output=True,
text=True,
check=True
)
ast = json.loads(result.stdout)
return ast
except subprocess.CalledProcessError as e:
print(f"Error compiling Vyper code: {e.stderr}")
return None
14 changes: 14 additions & 0 deletions libs/ast-extractor/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[tool.poetry]
name = "ast-extractor"
version = "0.1.0"
description = ""
authors = ["0xtekgrinder <0xtekgrinder@protonmail.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file.
Empty file added servers/servers/README.md
Empty file.
19 changes: 19 additions & 0 deletions servers/servers/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions servers/servers/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.poetry]
name = "servers"
version = "0.1.0"
description = ""
authors = ["0xtekgrinder <0xtekgrinder@protonmail.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
ast-extractor = {path = "../../libs/ast-extractor"}


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file.
Empty file added servers/servers/servers/ast.py
Empty file.
Empty file.
Loading