[Initial Feedback] New `like` and `match` keywords
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- typescript
- Ambito
- compilers
Direzione di ricerca
Inizia con la grammatica dei comparatori mostrata nell’issue e con le sezioni collegate di Parser.ts e TreeInterpreter.ts nell’implementazione TypeScript. Esamina la proposta collegata per le espressioni regolari interoperabili e il prototipo prima di decidere se la sintassi e la semantica di matching sono accettate. Il lavoro è completo quando esiste un design concordato sia per le parole chiave sia per le linee guida di implementazione in tutte le implementazioni JMESPath supportate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have been thinking that comparisons using new like and match keywords would be a natural extension.
The comparator rule would be extended like so:
comparator =/ "like" / "match"
Are these features that would be of interest?
Like
items[? foo like '**/*.json' ]
The like comparator would match simple SQL-like, wildcard-like or glob-like patterns.
I have investigated adding such contextual keywords to the language and found that it would probably easier with lex/yacc-based implementations, Nevertheless, using the top-down parser approach, one simply has to account for those keywords between the nud() and led() calls in the main parsing loop.
This makes the parsing algorithm less "pure" but I’m pretty sure more knowledgeable people might come up with more elegant designs.
Match
The match comparator would match simple regular expressions.
items[? foo match 'ba[rz]' ]
I know that regular expressions have been a touchy subject in the past but I strongly believe we can make this work for JMESPath with:
- A narrow focus on matching only, unanchored expressions. That is, the expression returns
trueorfalse. - Restricting the syntax to a tiny but useful subset of interoperable syntax.
I have come up with a prototype for a reference implementation of a simple push-down automaton-based checker and the implementation is reasonaly tight and compact.
I believe most languages in which a JMESPath implementation exists do indeed support the interoperable subset.
The idea from the standazdization document referred to above is to:
- First check that the syntax is valid.
- Maps the interoperable regex to one compatible with the target implementation.
- Execute the target implementation expression.
The standardization documents lists mappings for ECMAScript, PCRE, RE2, Go and Ruby dialects.
Once relying on such a compact library, the implementation is in fact really easy.
- Lingua principale
- Python
- Stelle
- 10
- Fork
- 3
- 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.jep
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
jmespath/jmespath.jep#36 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jmespath/jmespath.jep#35 ·
-
Root node accessAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jmespath/jmespath.jep#34 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jmespath/jmespath.jep#33 ·
-
Allow string comparisonAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
jmespath/jmespath.jep#32 ·
Tutte le issue di jmespath/jmespath.jep
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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
jmespath/jmespath.py#401 ·
-
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