Hacker News new | ask | show | jobs
by xvilka 2475 days ago
It lacks the syntax highlight. They could have used tree-sitter[1] for parsing, then the online highlight would be easier to implement.

[1] https://github.com/tree-sitter/tree-sitter

3 comments

Agreed, syntax highlighting would be great. I was thinking about something akin to fish's syntax highlighting and completion with the REPL.

I'll take a look at tree-sitter. If I get syntax highlighting for free then I'll take that!

> Dependency-free so that the runtime library (which is written in pure C) can be embedded in any application

What does dependency-free mean? I mean, it does depend on 128 crates. Do we typically not count those?

By the way, I did `cargo build` and it failed at `#include "utf8proc.c"`. I have `libutf8proc` installed. Changing `.c` to `.h` solved it. It went past that part, only to get:

- error: couldn't read cli/src/../../lib/binding_web/tree-sitter.js: No such file or directory (os error 2)

- error: couldn't read cli/src/../../lib/binding_web/tree-sitter.wasm: No such file or directory (os error 2)

The generator isn't dependency free, the parser it generates is.
perhaps you meant to include https://github.com/tree-sitter/tree-sitter as reference.
Oh, yes, clipboard mistake, thanks for the correction!