liquid-java / liquid-java/liquidjava
Change `return` to `$result` for method return values in refinements
- 主要語言
- Java
- 星號
- 67
- 分支
- 36
- 平均合併
- 10 天 18 小時
- 30 天內合併 PR
- 3
描述
`return` is a statement, and it's strange to have it as a variable to represent the return value.
Therefore, we could change it for `result`. But since result can be an actual variable that represents something other than the return value we, we can try using `$result`.
This would mean a small change in the grammar, probably, and a change in replacing the return value.
Ps: the _ should still work in any case
Example Before:
```java
@Refinement("return > 0")
int test2 (){
return 10;
}
```
Example After:
```java
@Refinement("$result > 0")
int test2 (){
return 10;
}
```
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先定位 refinement grammar,以及替換或檢查回傳值的程式碼;issue 提到了兩者,但沒有指出檔案或測試。將現有對 `return` 和 `_` 的處理方式與提議的 `$result` 語法進行比較,並在開始前考慮已開啟的 pull request。完成的標準是新語法能夠正常運作,且不會破壞現有行為。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- compilers
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100