Hacker News new | ask | show | jobs
by williamcotton 587 days ago
This is a WIP, but here's the test suite for a recursive decent powered search DSL:

https://github.com/williamcotton/search-query-parser-scratch...

Claude, using Projects, wrote perhaps 90% of this project with my detailed guidance.

It does a double pass, the first pass recursive descent to get strings as leaf nodes and then another pass to get multiple errors reported at once.

There's also a React component for a search input box powered by Monaco and complete with completions, error underlines and messaging, and syntax highlighting:

https://github.com/williamcotton/search-query-parser-scratch...

Feel free to browse the commit history to get an idea of how much time this saved me. Spoiler alert: it saved a lot of time. Frankly, I wouldn't have bothered with this project without offloading most of the work to an LLM.

There's a lot more than this and if you want a demo you can:

  git clone git@github.com:williamcotton/search-query-parser-scratchpad.git
  cd search-input-query-react
  npm install
  npm run dev
Put something like this into the input:

  -status:out price:<130 (sneakers or shoes)
And then play around with valid and invalid syntax.

It has Sqlite WASM running in the browser with demo data so you'll get some actual results.

If you want a guided video chat tour of how I used the tool I'd be happy to arrange that. It takes too much work to get things out of Claude.