1
1
mirror of https://github.com/wader/fq.git synced 2024-11-26 10:33:53 +03:00
Commit Graph

37 Commits

Author SHA1 Message Date
Mattias Wadman
af68511acf dev,doc Clarify some dev docs and rename launch.json to be a template 2023-05-01 17:39:43 +02:00
Mattias Wadman
b08ef00dd1 decode,interp: Refactor format groups into a proper struct
Replaces []Format with a Group type.
A bit more type safe.
Breaking change for RegisterFormat, now takes a first argument that is a "single" format group.
Lots of naming cleanup.

This is also preparation for decode group argument which will enable doing intresting
probing, ex a format decoder could know it's decode as part of probe group  (html could
be probed possibly), or have "arg probe" group for decoder who inspect args to know
if they should probe (-d /path/to/schema etc) to enable nice CLI-ergonomics.
2023-04-29 20:02:34 +02:00
Mattias Wadman
c5f6809b02 decode,fuzz,dev: Move recoverable error check to recoverfn.Run
This preserves the callstack on non-recoverable panics so that using
a debugger and fuzzing is much easier.

Add vscode debug config.
Remove fuzz stacktrace log workaround.
2023-03-31 12:47:04 +02:00
Mattias Wadman
e3ae1440c9 interp: Rename to/from<format> functions to to_/from_<format>
Feels less cluttered, easier to read and more consistent.

Still keep tovalue, tobytes etc that are more basic functions this
only renamed format related functions.
Also there is an exceptin for to/fromjson as it comes from jq.

Also fixes lots of spelling errors while reading thru.
2022-12-21 17:48:39 +01:00
Mattias Wadman
00ee10a1a1 interp: Make to{actual,sym} behave similar to tovalue
Before if you did toactual it behaved differently and even gave error for
a scalar that only had actual value set. Now both to{actal,sym} works
similar to tovalue but will force if actual or sym value should be used.
2022-09-25 17:53:12 +02:00
Mattias Wadman
226a9a3e08 generics: Use more from x/exp 2022-08-31 10:50:56 +02:00
Mattias Wadman
7d86534348 sortex: Package with type safe sort helpers 2022-08-30 11:02:57 +02:00
@0xb17bea125
abcc736653
add ULEB and SLEB to known words for spell check 2022-08-22 21:48:12 +09:00
Takashi Oguma
934ed9a809
wasm: initial version 2022-08-18 21:40:30 +09:00
Mattias Wadman
0cd846a18c *extra: Rename <pkg>extra to just <pkg>ex and refactor to use generics 2022-08-12 16:29:47 +02:00
Mattias Wadman
34cf5442b3 tcp: Split into client/server structs and add skipped_bytes and has_start/end per direction
Feels clenaer and removes _client/server field prefixes
2022-05-06 16:52:18 +02:00
Mattias Wadman
d8aaf30345 rtmp,amf0: Add decoders
Basic RTMP support, used via tcp_stream group (pcap etc) or manually.
Basic AMF0 support, mostly what is used in RTMP.
2022-04-01 13:07:20 +02:00
Mattias Wadman
dff7e7dadb interp: Cleanup binary regexp overloading and add explode
Add explode for binary that explode into an array of the binary unit tobits
Remove scan_toend as it feels a bit weird and one can use tobytes | .[match(...):] instead
Some general cleanup also
2022-03-09 20:17:12 +01:00
Mattias Wadman
cd2cbef6fe decode: Some cleanup
Fix PeekFind arg order
2022-02-17 00:25:24 +01:00
Mattias Wadman
0b0f28e966 cbor: Add decoder
Does not decode sematic tag types
Also fixes broken float16 support

Fixes #71
2022-01-12 17:56:03 +01:00
Mattias Wadman
628f0f403d bson: Add decoder
Only supports basic types for now
2022-01-06 00:51:37 +01:00
Mattias Wadman
91217e8210 tiff: Fix endian typo and cleanup todos 2021-12-12 11:26:00 +01:00
Mattias Wadman
c2131bb4a0 flac: Cleanup scalar usage and fix incorrect sample rates
Also split DisplayFormat into actual and sym
2021-12-08 00:39:52 +01:00
Mattias Wadman
f5a4d26931 vscode: Use tabsize 2 for jq files 2021-12-04 17:23:34 +01:00
Mattias Wadman
2f9d93d0ce doc: Improved readme and cleanup todo 2021-11-29 13:34:45 +01:00
Mattias Wadman
d838d2f613 zip: Add format decoder 2021-11-19 00:22:26 +01:00
Mattias Wadman
ede2e77975 decode: Nicer scalar template and add doc 2021-11-17 16:13:10 +01:00
Mattias Wadman
1b32b42f93 decode: Major decode API refactor
Generate more code
More generic and comfortable API
Improve and Update format decoder to new API
Add some more format tests
2021-11-15 21:12:07 +01:00
Mattias Wadman
96cc1283cd interp: Eval options in jq instead of calling jq from go
Simpler and causes less weird performance issues
2021-11-01 17:05:36 +01:00
Mattias Wadman
08142063b3 doc: Fix typos and old examples 2021-10-29 18:46:19 +02:00
Mattias Wadman
97f7317928 interp: Rework repl prompt code and fix some whitespace issues again 2021-10-28 12:08:19 +02:00
Mattias Wadman
ce044baf7e flac: Cleanup 2021-10-19 15:44:15 +02:00
Mattias Wadman
e86b45bd1a Add *grep/1/2 and find/1/2 2021-10-13 01:27:04 +02:00
Mattias Wadman
93fd097b53 cli: Add -M -C support and default to color if tty 2021-09-19 01:19:48 +02:00
Mattias Wadman
f5ffd32096 cli: Implement --arg, --argjson and --rawfile 2021-09-12 13:08:55 +02:00
Mattias Wadman
a49e924d5f decode: Use golang.org/x/text for text decoding 2021-09-12 13:08:55 +02:00
Mattias Wadman
ac8cfca500 cli: Make --raw-string work with input/0 and inputs/0
Also lots of refactor
2021-09-12 13:08:54 +02:00
Mattias Wadman
c8776abcc3 gojq: Update gojq fq fork 2021-09-12 13:08:54 +02:00
Mattias Wadman
e2ff2a277a cli: Move help/0 to inter.jq, better help for -n 2021-09-12 13:08:53 +02:00
Mattias Wadman
75cf46f8f4 cli: Refactor options code
Make nearly all options be just options and cli arguments
just sets various options.
2021-09-12 13:08:53 +02:00
Mattias Wadman
ae5566a6ce cli: Include paths and some refactor 2021-09-12 13:08:50 +02:00
Mattias Wadman
970465996c Init 2021-09-12 13:08:42 +02:00