liquid-java / liquid-java/liquidjava
State Names should be able to start with UpperCase
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 67
- Fork
- 36
- Merge medio
- 10g 18h
- PR unite (30g)
- 3
Descrizione
## 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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando la grammatica e il refinements AST parser, quindi traccia il modo in cui i nomi degli stati con iniziale maiuscola vengono attualmente classificati come alias. Esegui gli esempi descritti nell’issue e aggiungi o aggiorna i test che coprano sia gli stati con iniziale maiuscola sia gli alias. Il lavoro è completato quando i nomi degli stati con iniziale maiuscola validi vengono analizzati come stati senza interrompere la gestione degli alias.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100