liquid-java / liquid-java/liquidjava
State Names should be able to start with UpperCase
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Java
- Estrelas
- 67
- Forks
- 36
- Merge médio
- 10d 18h
- PRs com merge (30d)
- 3
Descrição
## 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
```java
@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
1. Allow in the grammar that states can be capital (confirm if it is needed).
2. When parsing the refinements AST make sure the capitalized states are treated as such and not as alias.
3. Test with examples.
## Current Approach
Check if any of the state names provided starts with uppercase - if so, immediately return with an error.
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece localizando a gramática e o refinements AST parser e, em seguida, rastreie como os nomes de estado capitalizados são atualmente classificados como aliases. Execute os exemplos descritos no issue e adicione ou atualize testes que cubram tanto estados capitalizados quanto aliases. Está concluído quando nomes de estado capitalizados válidos forem analisados como estados sem quebrar o tratamento de aliases.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- compilers
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 35/100