liquid-java / liquid-java/liquidjava

Change `return` to `$result` for method return values in refinements

未关闭
#133 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@rajshivu 已经在做这个了。

开始于 2026年2月9日。

  • #145 来自 @rajshivu —— 未关闭
enhancement good first issue
主要语言
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;
}
```

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位 refinement grammar,以及替换或检查返回值的代码;issue 提到了两者,但没有指出文件或测试。将现有对 `return` 和 `_` 的处理方式与提议的 `$result` 语法进行比较,并在开始前考虑已打开的 pull request。完成的标准是新语法能够正常工作,且不会破坏现有行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
compilers
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。