liquid-java / liquid-java/liquidjava
State Names should be able to start with UpperCase
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 67
- Forks
- 36
- Ø Merge
- 10 T. 18 Std.
- Gemergte PRs (30 T.)
- 3
Beschreibung
## 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Grammatik und den refinements AST parser zu lokalisieren, und verfolge dann, wie großgeschriebene Zustandsnamen derzeit als Aliase klassifiziert werden. Führe die im Issue beschriebenen Beispiele aus und füge Tests hinzu bzw. aktualisiere sie, die sowohl großgeschriebene Zustände als auch Aliase abdecken. Fertig ist die Änderung, wenn gültige großgeschriebene Zustandsnamen als Zustände geparst werden, ohne die Alias-Verarbeitung zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100