Function calls incorrectly formatted
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci il problema con gli snippet Zeek mostrati e il comando di parsing di tree-sitter. Traccia il comportamento di parsing e formattazione delle espressioni e delle chiamate di funzione; il lavoro è completato quando le chiamate adiacenti producono il CST corretto, le catene lunghe di chiamate non si interrompono più all’interno degli argomenti e tutte le chiamate possono essere associate per gli inlay hints.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When many function calls are part of the same expression they can be broken incorrectly, e.g., the following input
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1) +
f(1) + f(1);
is formatted with a line break inside the function call
f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(1) + f(
1) + f(1) + f(1) + f(1);
Looking at the produced CST this seems to be due to function calls in expressions not parsing correctly, e.g., with
f(1) + f(1);
I get
$ tree-sitter parse foo.zeek
(source_file [0, 0] - [1, 0]
(stmt [0, 0] - [0, 12]
(expr [0, 0] - [0, 11]
(expr [0, 0] - [0, 8]
(expr [0, 0] - [0, 4]
(expr [0, 0] - [0, 1]
(id [0, 0] - [0, 1]))
(expr_list [0, 2] - [0, 3]
(expr [0, 2] - [0, 3]
(constant [0, 2] - [0, 3]
(integer [0, 2] - [0, 3])))))
(expr [0, 7] - [0, 8]
(id [0, 7] - [0, 8])))
(expr_list [0, 9] - [0, 10]
(expr [0, 9] - [0, 10]
(constant [0, 9] - [0, 10]
(integer [0, 9] - [0, 10]))))))
(nl [0, 12] - [1, 0]))
If this had correct precedence I would expect two nodes (expr (expr (id)) (expr_list ...) next to each other; instead the function name of the second f gets incorrectly grouped next to the arguments of the first call.
The current "lightweight" impl also makes it impossible to match multiple function calls in the same expression, e.g., over in https://github.com/bbannier/zeek-language-server I cannot match all calls to compute parameter inlay hints, e.g.,
- Lingua principale
- Python
- Stelle
- 11
- Fork
- 4
- Merge medio
- 2g 19h
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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.
Altre issue di zeek/zeekscript
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
zeek/zeekscript#137 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
zeek/zeekscript#120 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
zeek/zeekscript#91 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
zeek/zeekscript#83 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
zeek/zeekscript#63 ·
Tutte le issue di zeek/zeekscript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
PedestrianDynamics/pyFDS-Evac#199 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
521xueweihan/HelloGitHub#3790 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
sandialabs/atlas-ui-3#978 ·
I maintainer di solito rispondono entro 1 giorno
-
area: tests perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Nitjsefnie-Harness-Commons/daedalus#1255 ·
I maintainer di solito rispondono entro 1 giorno
-
hf-audiolm-qwen: `generate_until` hardcodes `.to("cuda")` and aborts on non-CUDA acceleratorsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
EleutherAI/lm-evaluation-harness#4256 ·
I maintainer di solito rispondono entro 1 giorno