lexer: accept single quoted string literals
[oweals/jsonpath.git] / parser.y
index bdfc1f24a22f8408a7f9513be433ea1de017e6dc..75c33407586d39864d597a75d368a0bd8993cebc 100644 (file)
--- a/parser.y
+++ b/parser.y
@@ -41,7 +41,7 @@ void yyerror(struct jp_state *s, const char *msg);
 %parse-param { struct jp_state *s }
 %lex-param { struct jp_state *s }
 
-%code provides {
+%code requires {
 
 #ifndef __PARSER_H_
 #define __PARSER_H_
@@ -59,6 +59,7 @@ struct jp_state {
        struct jp_opcode *pool;
        struct jp_opcode *path;
        const char *error;
+       char str_quote;
        char str_buf[128];
        char *str_ptr;
 };
@@ -186,7 +187,7 @@ _jp_alloc_op(struct jp_state *s, int type, int num, char *str, ...)
        if (!newop)
        {
                fprintf(stderr, "Out of memory\n");
-               exit(1);
+               exit(127);
        }
 
        newop->type = type;