[Initial Feedback] New `like` and `match` keywords
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
- 領域
- compilers
調査の方向性
Issue に示されている比較演算子の文法と、TypeScript 実装内の Parser.ts および TreeInterpreter.ts のリンクされたセクションから始めてください。構文とマッチングセマンティクスを受け入れるかどうかを決定する前に、リンクされている相互運用可能な正規表現の提案とプロトタイプを確認してください。完了の条件は、キーワードと、サポートされているすべての JMESPath 実装にわたる実装ガイダンスの両方について、合意された設計があることです。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 10
- フォーク
- 3
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jmespath/jmespath.jep のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
jmespath/jmespath.jep#36 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jmespath/jmespath.jep#35 ·
-
Root node accessオープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jmespath/jmespath.jep#34 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jmespath/jmespath.jep#33 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
jmespath/jmespath.jep#32 ·
jmespath/jmespath.jep の issue をすべて見る
似ている issue
-
bug TAG: unit tests
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
learningequality/ricecooker#898 ·
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
freelawproject/litigant-portal#1285 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
jmespath/jmespath.py#401 ·
-
least_squares returns a nonfinite objective for an invalid initial residual対応中かも @sylvesterkaczmarek が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
google-deepmind/mujoco#4023 ·
メンテナーはふだん 11 日以内に返信
-
Five Australian birds: Red-capped Parrot, Red-winged Fairywren, Gilbert’s Honeyeater, Western Spinebill, Western Wattlebird対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
arnegiacomo/fugleramme#427 ·
メンテナーはふだん 1 日以内に返信