Lexer gives quoted identifiers an `end` that is the token length, not its end offset
@chiliec ci sta già lavorando.
Dal 12/10/2026.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 20/100
Direzione di ricerca
Read jmespath/lexer.py around line 185 and inspect _consume_quoted_identifier; the issue includes a reproducing expression and the incorrect token fields. Check the existing lexer tests for position assertions, then verify the quoted identifier's end is its end offset in foo."q".
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
While testing an experimental version of Perch, we found the following and figured it was worth a report.
_consume_quoted_identifier sets the token's end to the token's length instead of start + length, so it's wrong whenever the identifier isn't at the start of the expression:
>>> from jmespath.lexer import Lexer
>>> [t for t in Lexer().tokenize('foo."q"') if t['type'] == 'quoted_identifier']
[{'type': 'quoted_identifier', 'value': 'q', 'start': 4, 'end': 2}]
end is 2, which is before start. Every other token type uses start + len(...). Search results aren't affected; only the position information is wrong.
It's at jmespath/lexer.py:185:
return {'type': 'quoted_identifier', 'value': loads(lexeme),
'start': start, 'end': token_len}
'end': start + token_len would fix it. The lexer rewrite in #362 keeps the same line.
Tested on develop (2812594), Python 3.14.6, macOS 26.2.
- Lingua principale
- Python
- Stelle
- 2.5k
- Fork
- 231
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 jmespath/jmespath.py
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
jmespath/jmespath.py#401 ·
-
floor() and ceil() raise OverflowError / ValueError on Infinity and NaNForse già presa @guocn l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jmespath/jmespath.py#381 ·
-
sdist is missing `tests/__init__.py`Forse già presa @deepakganesh78 l’ha presa 127 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 38/100
jmespath/jmespath.py#341 · 1 commento ·
-
Different behavior on merge function between the JS lib and the Python libForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
jmespath/jmespath.py#329 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
jmespath/jmespath.py#328 · 1 commento · 1 reazione ·
Tutte le issue di jmespath/jmespath.py
Issue simili
-
test_real_pandoc_failure_is_one_path_free_line fails on macOS CI with current Homebrew pandocApertabug TAG: unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
learningequality/ricecooker#898 ·
-
task
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
freelawproject/litigant-portal#1285 ·
I maintainer di solito rispondono entro 2 giorni
-
least_squares returns a nonfinite objective for an invalid initial residualForse già presa @sylvesterkaczmarek l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google-deepmind/mujoco#4023 ·
I maintainer di solito rispondono entro 11 giorni
-
Five Australian birds: Red-capped Parrot, Red-winged Fairywren, Gilbert’s Honeyeater, Western Spinebill, Western WattlebirdForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
arnegiacomo/fugleramme#427 ·
I maintainer di solito rispondono entro 1 giorno
-
MONDO's zebu and cat Arnold-Chiari terms are is_a a dog disease (monarch-initiative/mondo#10939)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NCATSTranslator/Babel#1317 ·
I maintainer di solito rispondono entro 2 giorni