Commit graph

34 commits

Author SHA1 Message Date
Ruud van Asseldonk
59be133128 Bump version to 0.8.0
I'm leaving the Zed extension pointing to the older commit of the
Tree-sitter grammar, I'll update that after this version bump. It's
a bit awkward to do it this way around, but there are circular
dependencies that can't be avoided. Maybe with an attack on SHA1 it
can be done in theory, but let's not go there.
2025-03-02 21:15:33 +01:00
Ruud van Asseldonk
9dc5092279 Bump version to 0.7.0 2024-12-31 13:34:37 +01:00
Ruud van Asseldonk
2aabff47ee Dogfood-generate pyrcl Cargo.toml as well 2024-12-08 15:42:28 +01:00
Ruud van Asseldonk
7c7ea6246b Generate Cargo.toml files using RCL
I am tired of bumping the version number in 5 crates every time I need
to make a new release. RCL is built exactly to deduplicate that kind of
thing. So let's see how far I can get with generating all of this!
2024-12-08 15:42:28 +01:00
Ruud van Asseldonk
1bac59668e Bump version to 0.6.0
See docs/changelog.md for a summary of the changes in this release.
2024-12-01 11:52:49 +01:00
Ruud van Asseldonk
28d920e4ac Bump version to 0.5.0 2024-07-28 21:43:29 +02:00
Ruud van Asseldonk
2967267622 Bump version to 0.4.0 2024-07-13 10:37:59 +02:00
Ruud van Asseldonk
0993b3199c Bump version to 0.3.0 2024-06-23 11:08:49 +02:00
Ruud van Asseldonk
cda52d12c3 Ensure that we always have a span to insert into
Without this, appending at the end of the document will result in
missing characters.
2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
0edefa672e Fix cases in applying edits 2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
1acac1ae56 Add tests for new edit logic 2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
0467406153 Define an Edit type for tracking input edits
This is to preserve the syntax highlighting when the input contains a
parse error that prevents it from lexing.
2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
aef82e2cfc Implement wasm highlight using built-in lexer
No Tree-sitter, no obscure linker problems! It's not as robust and the
highlighting is less nice, but it's a lot easier to get working.
2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
0023bdd811 Implement syntax highlighting in wasm module 2024-06-23 11:05:08 +02:00
Ruud van Asseldonk
84523fd33c Save body span info in the loader
This fixes a longstanding issue where reporting errors that we have to
blame on just the document's result in general got blamed on its full
span, which is often a comment and not the offending value. Now we blame
it on the inner body expression, which is more natural.
2024-06-18 20:22:33 +02:00
Ruud van Asseldonk
1c3d3bd1c3 Update wasm html demo for new fn signatures 2024-03-19 20:52:07 +01:00
Ruud van Asseldonk
9fc4b01335 Make wasm print width and output limit configurable 2024-03-18 23:05:42 +01:00
Ruud van Asseldonk
ac75b56e15 Add a way to run queries from wasm 2024-03-18 21:14:21 +01:00
Ruud van Asseldonk
d13f6f9499 Add wasm functions to load a value
I am adding an example on the website for the json querying, and the
json value I want to only evaluate once and then keep it around. It
would be wasteful to re-evaluate it on every keystroke. So expose a
function to return an opaque value that we can later pass back in.
2024-03-18 20:48:06 +01:00
Ruud van Asseldonk
f7f7d7145a Struggle with box drawing glyphs in html
It renders ugly no matter what I try. The best thing would be to not
treat it as opaque monospace, and render html divs for those errors.
Then I can style the border using css. But then I need to edit the error
printing quite a lot, I don't want to do that right now. For now this is
good enough. One thing at a time.
2024-03-17 22:04:41 +01:00
Ruud van Asseldonk
7a21ee1197 Use the new wasm output in the demo page 2024-03-17 22:04:40 +01:00
Ruud van Asseldonk
c7ae7020da Output as html spans in wasm module
This enables us to have colored output.
2024-03-17 22:04:00 +01:00
Ruud van Asseldonk
0432eb5dfa Bump version to 0.2.0 2024-03-15 23:05:42 +01:00
Ruud van Asseldonk
6cdf06263a Simplify MarkupString to String conversion 2024-03-09 18:47:50 +01:00
Ruud van Asseldonk
07686fa855 Add an intermediate markup output to pretty-printer
For the wasm module, I want to generate html spans. So I need a way to
have the strings where the whitespace and newlines and such are already
handled, but the markup has not yet been applied. So split the
pretty-printer output into two stages, one where we build these spans,
and then one to write it to a string.

I fear this does make the output less efficient. Also all those &str
pieces that are two pointers wide for mostly tiny string fragments, that
hurts. But I must resist the urge to optimize prematurely.

I measure no significant difference:

Benchmark 1: /tmp/before eval --color=ansi big.json
  Time (mean ± σ):     11.162 s ±  0.384 s    [User: 10.080 s, System: 1.063 s]
  Range (min … max):   10.496 s … 11.922 s    10 runs

Benchmark 2: /tmp/after eval --color=ansi big.json
  Time (mean ± σ):     11.176 s ±  0.293 s    [User: 9.831 s, System: 1.326 s]
  Range (min … max):   10.823 s … 11.632 s    10 runs

Summary
  /tmp/before eval --color=ansi big.json ran
    1.00 ± 0.04 times faster than /tmp/after eval --color=ansi big.json
2024-03-09 18:47:50 +01:00
Ruud van Asseldonk
2fddfb4017 Guard wasm dependencies behind target.cfg
Without this, 'cargo test --all' fails because it wants to compile those
crates, even when we don't need them.
2024-03-05 21:21:36 +01:00
Ruud van Asseldonk
1b56769e82 Clarify some things in the wasm readme 2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
f4d81bcbf0 Add wasm output to the Nix flake
I was tired of running three commands manually all the time, and also,
I want this to still work one year from now. So let's do it with Nix.
2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
f5d20389d2 Make an interactive wasm playground work 2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
34e04a1a03 Propagate evaluation results to wasm
I can now get the full result and error!
2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
0fa1eff896 Make the wasm module load
Now the webpage doesn't throw any errors, and if it does report -1 for
an input that has a syntax error, and 0 for an input without syntax
errors, so this far it seems to work!
2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
4454d146c8 Add html page to test the wasm module 2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
74492d672e Document how to generate js bindings
Getting close to a runnable demo!
2024-03-05 21:09:04 +01:00
Ruud van Asseldonk
4cb10782d1 Add a wasm entry point
I now managed to produce a wasm module, I think. Next up is calling the
function.
2024-03-05 21:09:04 +01:00