liquid-java / liquid-java/liquidjava
State Names should be able to start with UpperCase
還沒有人認領這個 Issue。
- 主要語言
- Java
- 星號
- 67
- 分支
- 36
- 平均合併
- 10 天 18 小時
- 30 天內合併 PR
- 3
描述
Why
There is some confusion about what can be written in uppercase and lowercase, and we only defined that in the Grammar.
During the user study, some participants started writing the state names capitalized (i.e., first letter Upper Case and the remaining in lower case). However, the current grammar does not allow it since capitalization is reserved for Alias.
Maybe it would make sense to allow both types to be capitalized specially since we got different annotation for each that serve as syntax sugar but help desambiguate.
Example
@StateSet({"Uninitialized", "Initialized"})
public class SM1 {
@StateRefinement(to="Uninitialized(this)")
public SM1() {}
@StateRefinement(from="Uninitialized(this)", to="Initialized(this)")
public void initialize() {}
}
...
public static void main(String[] args) {
SM1 sm1 = new SM1();
sm1.initialize(); //Error
}
The states are capitalized so they are handled as alias which should not be the correct behavior.
Steps
- Allow in the grammar that states can be capital (confirm if it is needed).
- When parsing the refinements AST make sure the capitalized states are treated as such and not as alias.
- Test with examples.
Current Approach
Check if any of the state names provided starts with uppercase - if so, immediately return with an error.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先定位 grammar 和 refinements AST parser,然後追蹤目前如何將首字母大寫的狀態名稱分類為別名。執行 issue 中描述的範例,並新增或更新涵蓋首字母大寫狀態和別名的測試。完成標準是:有效的首字母大寫狀態名稱能夠解析為狀態,同時不破壞別名處理。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- java
- 領域
- compilers
- Issue 類型
- 功能
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100