Releases: Alligator/jqawk
Releases · Alligator/jqawk
0.6.1
0.6.0
New Features
- Key order is maintained when reading and writing objects (aa01981)
- Reinstated iterating over objects as root values (88c4979)
- Added
object.pairs()(38d8719) - Functions can be defined anywhere, and are first-class (a942aee, 9c4f893)
array.sort()can take a sort function argument (a942aee)- Added
number.format()(582adba) - Parsing continues after an error (27fc6d2)
Bugfixes
- Fixed negative indexing on strings (83ff9c6)
0.5.9
0.5.8
New Features
- Added
BEGINFILEandENDFILErules (d3b4a1e) - Added
number.floor(),number.ceil()andnumber.round()methods (9b7a67e) - The root selector flag can be set multiple times (7debf99)
- Newline separate JSON (jsonl) is now supported (81e9d61)
- This means jqawk can now be used to process a stream of JSON documents in real time
0.5.6
New Features
- Arrays can be indexed with negative numbers, to count backwards from the end of the array (06b59fa)
- Added a new
isoperator for type checking (86afa55)- e.g.
if (myValue is bool) print 'bool'; - Valid type names are
string,bool,number,array,object,function,regexandunknown
- e.g.
- Added an
array.sort()method (a084958)- If the array contains only numbers, it will be sorted numerically. If it contains anything that isn't a number, all values are converted to strings before sorting
Bugfixes
- Implicitly creating an array containing an object now works (d0be3e4, 82d7722)
- e.g.
a[0].thing = 2whereais not defined
- e.g.
- Array literals, object literals and function calls now copy primitives by value, instead of by reference (26c0305)
- Stop
array.pop()andarray.popfirst()panicking on empty arrays (b0ef491) num()now returns null instead of panicking if it can't parse a number (b0ef491)- Stopped the cli panicking if it's run with no arguments (912ed03)
0.5.5
Breaking changes
int()has been replaced bynum()returncan only appear inside a functionbreakandcontinuecan only appear inside loops- There's now a max call depth of 4096
Bug fixes
Lots of bugs found by the fuzzer.
- Arrays, objects and functions are now truthy (67907c3)
nullon either side a comparison actually works (f894988, fa41ccb)- Numbers are parsed as floats instead of integers (30d279c)
++and--operators now implicitly create objects and arrays (9785296)- printing an object containing a circular reference not to the root object no longer causes a stack overflow (7eb0056)
%vinprintfnow checks for missing arguments (7082bf5)
0.5.4
New features
- Multiple files can be passed to jqawk
- All rules except
BEGINandENDwill run for each file
- All rules except
nullis now a keyword- Comparisons like
$.a != nullnow work
- Comparisons like
Breaking changes
$is no longer set inBEGINandENDrules- These rules now run before and after processing any JSON
0.5.3
New features
- Arrays are implicitly created if an unknown variable is indexed with a number
- Object chain can be implicity created
- If
ais unknown,a.b.c.d = 4will createaand all the intervening objects
- If
- Added the
exitstatement, which immediately exits the program
0.5.2
New features
- Added
string.upper()andstring.lower() - Added
object.pluck()
Bug fixes
- An argument count mismatch in a native function now causes a runtime error instead of a panic
- Printing or
json()-ing an object with circular references no longer panics -dbg-lexshows a regex as one token, instead of a sequence of tokens
Other changes
What can appear on the left-hand side of an assignment is now restricted. The following cannot appear:
- Literals
- Arrays
- Objects
- Binary expressions, except property (
a.b) and index (a[b]) expressions
0.5.1
New features
- Jqawk can run with no input. e.g.
jqawk 'BEGIN { print "hello, world" }' - Width specifiers in printf
-versionflag
Bug fixes
- A few things are now runtime errors instead of go panics:
- Divide by zero with
/and%operators - Parsing a number bigger than an int64
- A single
\at the end of a string - An invalid regex
- Divide by zero with
- Assignment from a regex no longer panics
- Assignment from an unknown value no longer panics