81e2336ace
Support ."foo" syntax for accessing fields. See #141 .
2013-06-11 22:26:39 +01:00
2ffbb9d6b7
Lex and parse .foo better.
...
'.as' is now valid, '. foo' is now invalid. See #141 .
2013-06-05 13:41:56 +01:00
2c4ccd122e
Better error handling for .foo case in parser. See #141 .
2013-06-03 23:12:31 +01:00
b90ae078b8
Let the parser rather than the lexer handle invalid characters.
2013-06-03 23:12:31 +01:00
bc42812715
Remove the insane "fold" operation, replace with saner "reduce".
2013-05-16 15:07:53 +01:00
33901b74b1
Array slicing. Closes #2 .
2013-05-13 20:16:19 +01:00
d8706fd460
Fix the //= operator.
...
Closes #62 .
2013-05-13 16:04:30 +01:00
2363246eea
Merge remote-tracking branch 'stagrlee/master' into autotools
...
Conflicts:
Makefile
jq_test.c
2013-05-08 00:52:24 +01:00
5be97463ec
Add a --arg option to allow variables to be passed from the cmdline.
...
Closes #107
2013-05-06 14:21:00 +01:00
c7725a8d4d
merging upstream stedolan changes
2013-02-02 20:39:23 -06:00
925ec3751f
Fix negative number syntax. Add a unary '-' operator.
...
Closes #63 .
2013-01-03 12:53:23 +00:00
d5fdf70434
Refactor assignment.
...
New version is much more elegant and probably slower. Uses
library functions implemented in jq rather than dedicated opcodes.
2012-12-29 16:43:36 +00:00
f1e23448e7
Support for two-argument functions.
...
Should probably support n args instead. This is a quick hack.
Also, ';' is a slightly ugly argument separator.
2012-12-28 15:07:27 +00:00
417899f9a0
Fold operation (code/docs/test)
2012-12-28 15:05:34 +00:00
89e26969ae
@foo syntax for encoding of strings into various formats.
...
Fixes part of #47 and #48 .
2012-12-28 01:23:09 +00:00
04daafbde3
Add wrappers for malloc/realloc/free. See #43 .
2012-12-18 16:53:51 +00:00
84026f0513
Change order of evaluation for certain indexing operations.
...
'.foo[.bar]' used to parse like '.foo | .bar as $b | .[$b]',
now it parses like '.bar as $b | .foo | .[$b]'.
2012-12-07 00:28:11 +00:00
616e8f9924
Refactor function argument passing into what it always should have been.
...
Most visible change is that error messages when a function is called
with the wrong number of arguments are much better.
2012-12-04 00:39:21 +00:00
a88d53d2fd
Extend {foo}
syntax to allow {"foo"}
as well.
...
Useful when "foo" contains unusual characters. Should help with
the issues #7 , #38 , #40 , #42 .
2012-12-03 20:31:40 +00:00
5f6a95c7b5
General cleanup - rename a few things, delete dead code.
2012-12-03 20:02:02 +00:00
ed7f95a492
Demote "contains" to a built-in function rather than an operator.
2012-12-02 22:52:38 +00:00
63d10433c9
Fix a horrible scoping/associativity bug.
...
`1 as $x | . | $x` didn't compile, as it was parsed as
(1 as $x | .) | $x
where `$x` is undefined, rather than as
1 as $x | (. | $x)
2012-12-02 22:22:08 +00:00
ddeec45b2e
revert back to make invoking flex, fix a few bugs
2012-11-28 01:08:23 -06:00
2dad2bdd97
Merge remote-tracking branch 'origin/master'
2012-11-26 22:24:04 +00:00
4747f8681b
Transparent handling for CBV arguments to C functions.
...
C function arguments closures are inlined before the call.
2012-11-26 01:36:55 +00:00
3e3fe51959
Clean up function creation API and epilogue generation.
2012-11-26 00:39:01 +00:00
924aeda504
Add some preprocessor junk to make codegen cleaner.
2012-11-25 23:49:57 +00:00
50bcbc2271
Merge branch 'master' of https://github.com/stedolan/jq into contains-operator
...
Conflicts:
lexer.gen.c
parser.gen.c
parser.gen.h
parser.gen.info
parser.y
2012-10-25 10:02:02 -07:00
72691b4909
Fix a bug in string parsing. Closes #35
2012-10-25 00:13:39 +01:00
5e25c2a259
Implemented contains operator
2012-10-24 13:50:26 -07:00
e40778727b
Replace yyscan_t with another pointer type that we control.
...
This prevents the circuluar dependency between parser.gen.h and
lexer.gen.h. Newer versions of bison add a prototype for yyparse() to
parser.gen.h that include the as-yet-undeclared yyscan_t type.
2012-10-24 09:28:27 +02:00
553de39b2a
Implement 'not equal' (!=) as a binop
2012-10-23 17:01:39 +02:00
b193bca563
yyscan_t isn't exposed by some versions of flex.
2012-10-23 17:00:42 +02:00
afec2544f1
A string interpolation syntax that I don't hate. Also tests.
...
You can interpolate values into strings using \(this syntax), e.g.
"best \("str" + "ing") ever"
2012-10-20 00:09:20 +01:00
b3557429eb
Make comp binops nonassoc
2012-10-10 23:00:24 +01:00
0618e61e0b
Add <,>,<=,>= binops
2012-10-07 22:34:12 +01:00
a4eea165bb
Move everything around - delete old Haskell code, clean up build.
2012-09-18 17:44:43 +01:00