ConsenSysDiligence / ConsenSysDiligence/python-solidity-parser

Feature Request: Get object's raw source

未關閉
#21 2 則留言 2 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
145
分支
40
PR 合併指標
30 天內沒有已合併 PR

描述

Hi,

How are you? Thanks of all, thanks for doing the port of the tool, I was thinking of doing it myself and I found someone else did it :smile:

I was wondering if there was a way to get the raw source of an objects, let's say a contract or function.

I was thinking in something like:

```
sourceUnitObject = parser.objectify(sourceUnit)
raw_text = sourceUnitObject.contracts['MyContract'].raw
print(raw_text)
>>'contract MyContract { ..'
```

Thanks!

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

先追蹤 parser.objectify(sourceUnit) 和 parser 的 ANTLR4 文法,以了解 contract 物件和 function 物件是如何建立的。確定如何為這些物件保留來源文字,然後驗證 sourceUnitObject.contracts['MyContract'].raw 是否回傳預期的 contract 文字,以及等效的 function 存取是否運作。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python, solidity
領域
compilers
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。