summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-06-15 16:31:14 +0200
committerJo-Philipp Wich <jow@openwrt.org>2014-06-15 20:59:37 +0200
commitf3830138661374ca10fe6a0b6f2f4b949dea3e5c (patch)
tree22c1e28df47e02f941dba8160090186481941a0c /main.c
parent960dafd0b61eb14032d13c1562566618be55133f (diff)
downloadjsonpath-f3830138661374ca10fe6a0b6f2f4b949dea3e5c.tar.gz
Switch to sqlite3's lemon parser generator.
This commit drops the flex + bison code in favor to a hand-written lexer and a new grammar file in lemon syntax. The change results in a much smaller binary and easier to maintain code. Code required to build and maintain the AST has been split off into the ast.c and ast.h files. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main.c b/main.c
index eaa1ee0..ebd52c0 100644
--- a/main.c
+++ b/main.c
@@ -263,8 +263,9 @@ filter_json(int opt, struct json_object *jsobj, char *expr)
if (!state || state->error)
{
- fprintf(stderr, "In expression '%s': %s\n",
- expr, state ? state->error : "Out of memory");
+ fprintf(stderr, "Syntax error near {%s}: %s\n",
+ state ? expr + state->erroff : expr,
+ state ? state->error : "Out of memory");
goto out;
}