GDQuest / GDQuest/GDScript-formatter

Parse error when annotation and a `const` variable are on the same line

Aperta
#329 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
upstream
Lingua principale
Rust
Stelle
455
Fork
39
Merge medio
1g 15h
PR unite (30g)
4

Descrizione

Input:

```gdscript
func test_warnings():
@warning_ignore("unused_local_constant") const unused_local_constant = 1
```

Error: `the input GDScript code contains parse errors`

This code is fine:

```gdscript
func test_warnings():
@warning_ignore("unused_local_constant") var unused_local_constant = 1
```

This is also fine (but it gets formatted into the input code and you get the same error when formatting again):

```gdscript
func test_warnings():
@warning_ignore("unused_local_constant")
const unused_local_constant = 1
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Reproduce the reported annotation-plus-const input and compare it with the working var and multiline const cases. Trace the formatter/parser entry point that handles annotations and local declarations; done means the one-line const form parses successfully and repeated formatting does not reintroduce the error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
godot, rust
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
65/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.