liquid-java / liquid-java/liquidjava
State Names should be able to start with UpperCase
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 67
- Fork
- 36
- Merge trung bình
- 10 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 3
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách xác định grammar và refinements AST parser, sau đó lần theo cách các tên state viết hoa hiện được phân loại là alias. Chạy các ví dụ được mô tả trong issue và thêm hoặc cập nhật các test bao quát cả state viết hoa và alias. Hoàn thành khi các tên state viết hoa hợp lệ được parse thành state mà không làm hỏng việc xử lý alias.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- compilers
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100