liquid-java / liquid-java/liquidjava
Change `return` to `$result` for method return values in refinements
- Dominant language
- Java
- Stars
- 67
- Forks
- 36
- Avg merge
- 10d 18h
- Merged PRs (30d)
- 3
Description
`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;
}
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the refinement grammar and the code that replaces or checks return values; the issue mentions both but names no files or tests. Compare the existing `return` and `_` handling with the proposed `$result` syntax, and consider the open pull request before starting. Done means the new syntax works without breaking existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100