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

173 Commits

Author SHA1 Message Date
Mattias Wadman
804ad1e2a2 gojq: Update fq fork
Fixes https://github.com/itchyny/gojq/issues/186
skip appending path while variable argument evaluation
2022-08-22 15:42:14 +02:00
Mattias Wadman
394717cae8 gopacket: Switch/update to new fork, remove SLL2 hack
SLL2 support merged upstream https://github.com/gopacket/gopacket/pull/1

This also cuts down a bit on some indirect deps
2022-08-20 01:25:03 +02:00
Mattias Wadman
add3dcfd91 gojq: Update fq fork, fix scope argcount issue 2022-08-16 12:04:36 +02:00
Mattias Wadman
d898732c3d gojq: Update fq fork, new scope function, rawstring, stricter integers
Update repl completion for new scope/0 function, now reports name/arity and is more correct
Support for experimental `rawstring` literals, similar to go raw string literals
Sticter number literals, now 0b,0o and 0x fail it they have invalud symbols, ex: 0b123
2022-08-14 22:40:44 +02: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
af35b2848d gojq: Preserve keys order for to_entries when used with JQValue
Feels like what one would expect when doing to_entries on a decode value struct etc,
that is get the pairs in same order as decoder wants.

Quite sure this used to the case but was change to sorted key order when
to_entries was move from bein implemented in jq to be internal for performance
reasons. Now internal gojq to_entries has a special case for JQValue objects.

Also use new gojq.JQType* constants for type strings and switch binary type
to look more like strings. Can still use _exttype to get "binary".
2022-07-26 15:55:58 +02:00
Mattias Wadman
cae288e6be format,intepr: Refactor json, yaml, etc into formats also move out related functions
json, yaml, toml, xml, html, csv are now normal formats and most of them also particiate
in probing (not html and csv).

Also fixes a bunch of bugs in to/fromxml, to/fromjq etc.
2022-07-23 21:48:45 +02:00
bump
62be9223b3 Update gomod-BurntSushi/toml from 1.1.0 to 1.2.0
Source diff 1.1.0..1.2.0 https://github.com/BurntSushi/toml/compare/v1.1.0..v1.2.0
2022-07-20 16:33:59 +00:00
Mattias Wadman
a5122690e4 readline: Rebase on top of tpodowd's update PR
Fixes:
Tab Completion Candidate Pager for when candidates don't fit on a single page
https://github.com/chzyer/readline/pull/207
2022-07-04 11:21:31 +02:00
Mattias Wadman
c57dc17d17 gojq: Rebase fq fork
Expose number parse validate functions, will be used later by text format decoders:
gojq.ValidNumber(s string)
gojq.NormalizeNumber(v json.Number)
gojq.NormalizeNumbers(v interface{})

From upstream:
Fixes: Regression since dace191 (fix fromjson to keep integer precision (close #172)) (https://github.com/itchyny/gojq/issues/178)
otherwise mostly cosmetic and cleanups since last rebase
2022-07-03 11:55:28 +02:00
Mattias Wadman
d45fee5221
Merge pull request #306 from wader/golang.org/x/net-crypto-update
mod: Update golang.org/x/{crypto,net}
2022-07-01 20:00:25 +02:00
Mattias Wadman
c2a359bdbd mod: Update golang.org/x/{crypto,net} 2022-07-01 19:47:45 +02:00
Mattias Wadman
44bab2746a readline: Rebase on top of tpodowd's redraw/completion fixes PR
Also some cleanup and fixup of commits

https://github.com/chzyer/readline/pull/207
2022-07-01 19:43:39 +02:00
Mattias Wadman
c1a0cda5a8 gojq: Update rebased fq fork
Fix tostring for non-string JQValue:s, is now JSON
Update EOF error
2022-06-01 17:27:45 +02:00
Mattias Wadman
3b717c3ba4 interp: Add to/from<encoding> for some common serialzations, encodings and hashes
Add toxml/fromxml for XML encoding, mighe be lossy on ordering
fromxml has {seq:bool} to add #seq attributes to improve ordering
toxml has {indent:number} to choose space indent depth

Add tojson, same as in jq but also has {indent:number} options

Add toyaml/fromyaml for YAML

Add totoml/fromtoml for TOML

Add tojq/fromjq for jq-flavored JSON (optional quotes for keys, comments and trailing commas support)

Add tocsv/fromcsv for CSV
formcvs takes {comma:string, comment:string} for custom separtor and comment character

Rename/split hex into tohex/fromhex
Rename/split base64 into tobase64/frombase64
tobase64/frombase64 takes {encoding:string} option for base64 flavour (std, url, rawstd, rawurl)

Add to/from<format> urlpath, urlquery, url, xmlentities, base64, hex

Add to<hash> md4, md5, sha1, sha256, sha512, sha3_224, sha3_256, sha3_384, sha3_512

Add to/from<encoding> iso8859-1, utf8, utf16, utf16le, utf16be
2022-05-28 16:31:20 +02:00
Mattias Wadman
9a7ce14886 gojq: Update rebased fq fork
Use new gojq.TypeOf and gojq.Preview
2022-05-23 21:33:12 +02:00
Mattias Wadman
59c7d0df6b gojq: Rebase fq fork 2022-05-23 11:26:09 +02:00
Mattias Wadman
54dcdce909 readline: Update fq fork
Rebase on master
Cherry-pick https://github.com/chzyer/readline/pull/202
2022-05-19 16:56:22 +02:00
Mattias Wadman
0f78687b78 gojq: Fix JQValue index and destructuring issue and rebase fq fork
Rebase on upstream main
Fix issue using JQValue as object index
Fix issue destructuring JQValue array
2022-05-03 18:22:26 +02:00
Mattias Wadman
f4480c6fe5 decode,interp: Support for format specific options
interp: Refactor format help and also include options
interp: Add -o name=@path to load file content as value (not documented yet, might change)
interp,decode: Expose decode out value as _out (might change)
interp: Refactor foramts.jq into format_{decode,func,include}.jq
interp: Refactor torepr into _format_func for generic format function overloading
interp: Refactor -o options parsing to be more generic and collect unknowns options to be used as format options
decode of decode alises
func for format overloaded functions
include for format specific jq functions (also _help, torepr etc)
flac_frame: Add bits_per_sample option
mp3: Add max_unique_header_config and max_sync_seek options
mp4: Add decode_samples and allow_truncate options
avc_au: Has length_size option
hevc_au: Has length_size option
aac_frame: Has object_typee option
doc: Rewrite format doc generation, less hack more jq
2022-05-01 17:08:30 +02:00
bump
d9195ac48a Update gomod-mapstructure from 1.4.3 to 1.5.0
CHANGELOG https://github.com/mitchellh/mapstructure/blob/master/CHANGELOG.md
2022-04-21 16:08:54 +00:00
Mattias Wadman
afd724bf9c gojq: Rebase fq fork. Fixes JQValue path tracking when iterating
Add some decode value path and assign tests
2022-04-19 19:00:37 +02:00
Mattias Wadman
02a97fa39a gojq: Rebase fq fork
debug code conflict and removed some unused code
2022-04-17 19:45:58 +02:00
Mattias Wadman
518f6af4a8 gojq: Rebase fq fork
Upstream changes:
Many performance improvements
Error message improvments
Lots of refactoring

Most of the JQValue interface changes in gojq fork had to be reworked but
resultet in a much nicer and cleaner changeset.

fq changes:
Assignment to JQValue (like a decode value) now shallowly converts the value into
a jq value before assigning. Was a bit hacky as it was and this makes JQValue
behave more like real jq values. This also fixes some advanced indexing issues.

Actual custom path updates will be something for the future.
2022-04-11 19:23:15 +02:00
Mattias Wadman
dd0d97eabc gojq: Rebase fq fork (speedup and fix range with JQValue)
Include upstream speedups to:
flatten
join
ltrimstr
rtrimstr
startswith
endswith
min_by
max_by
min
max
sort
2022-03-28 22:51:23 +02:00
Mattias Wadman
adde8c7004 gojq: Rebase fq fork 2022-03-21 10:47:22 +01:00
Mattias Wadman
2e240447e3 gojq: Rebase fq fork 2022-03-16 10:26:59 +01:00
Mattias Wadman
8c91870235 gojq: Rebase fq fork 2022-03-14 18:35:17 +01:00
Mattias Wadman
88f791e0fa gojq: Rebase fq fork 2022-03-14 14:22:47 +01:00
Mattias Wadman
d79afeb386 gojq: Rebase fq fork
Includes from_entries optimization
2022-03-12 18:51:23 +01:00
Mattias Wadman
be6f00935f gojq: Rebase fq fork and add support for non-10 base for tonumber
tonumber now works with non-10 number literals
Fix try precedences changes
Fix .[]? error handling changes
2022-03-02 23:46:20 +01:00
Xentripetal
9636613ec6 Merge branch 'master' of https://github.com/wader/fq into avro 2022-02-12 22:16:50 -06:00
Mattias Wadman
b55ca2cd5d gojq: Rebase fq branch
Add bin,hex,oct bigint number literal tests
2022-02-12 13:03:38 +01:00
Xentripetal
31c4c0d3c4 Support snappy and deflate codecs 2022-02-07 23:03:50 -06:00
Mattias Wadman
36d28913ae readline: Update to verison with less deps
Should make it easier to package for debian etc
2022-01-18 00:40:12 +01:00
Mattias Wadman
be0ef80c8d interp,fq: Make bit operators normal functions
Uses same rule as jq math functions, 1 arg uses input, more than one all passed as args.
So "bnot 1" -> "1 | bnot", "1 bsl 1" -> "bsl(1; 1)"

Don't think it's worth changing the jq syntax for this and also it could make fq
scripts no compatiblr with other jq tools. Non-10 base number literals are still allowed
but should probably not be used in scripts, only in repl and with cli.
2022-01-09 01:06:36 +01:00
Mattias Wadman
1500fd90e4 gojq: Update to rebased fq fork 2021-12-11 11:23:11 +01:00
bump
d4b2d58b1b Update gomod-mapstructure from 1.4.2 to 1.4.3 2021-12-02 18:11:39 +01:00
Mattias Wadman
f55b1af6ac inet: Add tcp and ipv4 reassembly
Also add tcp_stream and udp_payload to decode content
2021-11-29 18:42:18 +01:00
Mattias Wadman
bfec366613 gojq: Update fq fork 2021-11-05 17:40:21 +01:00
Mattias Wadman
4104a18697 gojq: Update fq fork 2021-10-30 18:25:23 +02:00
Mattias Wadman
093ee71bc4 gojq: Update fq fork 2021-10-20 19:28:01 +02:00
Mattias Wadman
ac7568d2c6 gojq: Update gojq fq fork 2021-10-19 15:43:48 +02:00
Mattias Wadman
3044fefb5b gojq: Update fq fork 2021-10-12 18:10:20 +02:00
Mattias Wadman
0b9055819a gojq: Update fq fork 2021-10-08 22:54:42 +02:00
Mattias Wadman
5a5f01e179 gojq: Update fq fork 2021-10-02 12:12:46 +02:00
Mattias Wadman
d365ab794f gojq: Update gojq fq fork 2021-09-28 23:33:56 +02:00
Mattias Wadman
b75da3001a gojq: Update jq fork
simlify error.typeof in gojq
2021-09-22 18:58:28 +02:00
Mattias Wadman
f4cd7bff3c gojq: Update jq fork
join/1 improvments
2021-09-22 18:43:38 +02:00
Mattias Wadman
528e6b91ab interp: Refactor and use mapstructure 2021-09-22 01:35:27 +02:00
Mattias Wadman
5c733adff3 readline: Update fq fork
Fix word delete before first word
Multi line move backwards redraw fix
Undo support
Shift-tab go back completion
Windows delete support
2021-09-20 14:48:32 +02:00
Mattias Wadman
bf5c222acb gojq: Update fq fork 2021-09-19 12:07:37 +02:00
Mattias Wadman
8277b79c21 gojq: Update fq fork, support JQValue alt // 2021-09-16 00:46:25 +02:00
Mattias Wadman
31a5047fcd gojq: Update fq fork 2021-09-14 14:53:01 +02:00
Mattias Wadman
1d15c1d0f2 gojq: Update fq fork 2021-09-12 13:08:56 +02:00
Mattias Wadman
a49e924d5f decode: Use golang.org/x/text for text decoding 2021-09-12 13:08:55 +02:00
Mattias Wadman
49f541c317 cli: Add proper repl iterator support 2021-09-12 13:08:54 +02:00
Mattias Wadman
845bc6b917 gojq: Update gojq fq fork 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
f828ae1319 gojq: Update gojq fq fork
Removed some unneeded error changes in fork
2021-09-12 13:08:53 +02:00
Mattias Wadman
f5164eeef7 gojq: Update fq gojq fork
Includes try error performance fix
2021-09-12 13:08:53 +02:00
Mattias Wadman
6420928be3 gojq: Update gojq fq fork 2021-09-12 13:08:52 +02:00
Mattias Wadman
1888bb2892 gojq: Remove div operator
Add intdiv function intead
2021-09-12 13:08:52 +02:00
Mattias Wadman
a34784d7ba gojq: Update fq gojq fork 2021-09-12 13:08:52 +02:00
Mattias Wadman
7ad3d2550c gojq: Update fq gojq fork 2021-09-12 13:08:52 +02:00
Mattias Wadman
03af2b5046 gojq: Update rebased fq branch 2021-09-12 13:08:51 +02:00
Mattias Wadman
f1507f7f65 mod: Use proper path and dont use replace 2021-09-12 13:08:50 +02:00
Mattias Wadman
1436fdc8ba completion: Better and _internal handling 2021-09-12 13:08:50 +02:00
Mattias Wadman
d7dbe7ccbd gojq: Update fq branch to fix mod (-1 % 256) difference 2021-09-12 13:08:50 +02:00
Mattias Wadman
0c7fa090b0 gojq: Initial update support
decode value give no updateable error
JQValue json value tries to replicate behaveior
2021-09-12 13:08:50 +02:00
Mattias Wadman
c3b7b5cad2 gojq: Update to rebased fq branch 2021-09-12 13:08:50 +02:00
Mattias Wadman
2d6573d573 gojq: Update to rebased fq branch 2021-09-12 13:08:49 +02:00
Mattias Wadman
970465996c Init 2021-09-12 13:08:42 +02:00