Skip to content

Commit

Permalink
merge: PR #6 from 4-ast-extractor-vyper into dev
Browse files Browse the repository at this point in the history
feat: final version ast extractor
  • Loading branch information
0xtekgrinder authored Sep 14, 2024
2 parents bf0d469 + cb09cb5 commit 9576370
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 0 deletions.
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.

0 comments on commit 9576370

Please sign in to comment.