Validate module metadata to be an object (#2357)
This commit is contained in:
1 parent
5dacc6b3a1
commit
6d694a4a58
7 files changed
+1702
-1389
No files matched your search
@@ -514,6 +514,7 @@ jv block_list_funcs(block body, int omit_underscores) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
block gen_module(block metadata) {
|
block gen_module(block metadata) {
|
||||||
|
assert(block_is_const(metadata) && block_const_kind(metadata) == JV_KIND_OBJECT);
|
||||||
inst* i = inst_new(MODULEMETA);
|
inst* i = inst_new(MODULEMETA);
|
||||||
i->imm.constant = block_const(metadata);
|
i->imm.constant = block_const(metadata);
|
||||||
if (jv_get_kind(i->imm.constant) != JV_KIND_OBJECT)
|
if (jv_get_kind(i->imm.constant) != JV_KIND_OBJECT)
|
||||||
|
|||||||
+18
-17
@@ -1,6 +1,6 @@
|
|||||||
#line 2 "src/lexer.c"
|
#line 1 "src/lexer.c"
|
||||||
|
|
||||||
#line 4 "src/lexer.c"
|
#line 3 "src/lexer.c"
|
||||||
|
|
||||||
#define YY_INT_ALIGNED short int
|
#define YY_INT_ALIGNED short int
|
||||||
|
|
||||||
@@ -281,6 +281,7 @@ typedef int16_t flex_int16_t;
|
|||||||
typedef uint16_t flex_uint16_t;
|
typedef uint16_t flex_uint16_t;
|
||||||
typedef int32_t flex_int32_t;
|
typedef int32_t flex_int32_t;
|
||||||
typedef uint32_t flex_uint32_t;
|
typedef uint32_t flex_uint32_t;
|
||||||
|
typedef uint64_t flex_uint64_t;
|
||||||
#else
|
#else
|
||||||
typedef signed char flex_int8_t;
|
typedef signed char flex_int8_t;
|
||||||
typedef short int flex_int16_t;
|
typedef short int flex_int16_t;
|
||||||
@@ -445,7 +446,7 @@ struct yy_buffer_state
|
|||||||
/* Number of characters read into yy_ch_buf, not including EOB
|
/* Number of characters read into yy_ch_buf, not including EOB
|
||||||
* characters.
|
* characters.
|
||||||
*/
|
*/
|
||||||
int yy_n_chars;
|
yy_size_t yy_n_chars;
|
||||||
|
|
||||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||||
* and can realloc() it to grow it, and should free() it to
|
* and can realloc() it to grow it, and should free() it to
|
||||||
@@ -522,7 +523,7 @@ static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner
|
|||||||
|
|
||||||
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
|
||||||
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
|
||||||
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner );
|
||||||
|
|
||||||
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
|
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
|
||||||
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
|
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
|
||||||
@@ -569,7 +570,7 @@ static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
|
|||||||
*/
|
*/
|
||||||
#define YY_DO_BEFORE_ACTION \
|
#define YY_DO_BEFORE_ACTION \
|
||||||
yyg->yytext_ptr = yy_bp; \
|
yyg->yytext_ptr = yy_bp; \
|
||||||
yyleng = (int) (yy_cp - yy_bp); \
|
yyleng = (yy_size_t) (yy_cp - yy_bp); \
|
||||||
yyg->yy_hold_char = *yy_cp; \
|
yyg->yy_hold_char = *yy_cp; \
|
||||||
*yy_cp = '\0'; \
|
*yy_cp = '\0'; \
|
||||||
yyg->yy_c_buf_p = yy_cp;
|
yyg->yy_c_buf_p = yy_cp;
|
||||||
@@ -842,8 +843,8 @@ struct yyguts_t
|
|||||||
size_t yy_buffer_stack_max; /**< capacity of stack. */
|
size_t yy_buffer_stack_max; /**< capacity of stack. */
|
||||||
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
|
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
|
||||||
char yy_hold_char;
|
char yy_hold_char;
|
||||||
int yy_n_chars;
|
yy_size_t yy_n_chars;
|
||||||
int yyleng_r;
|
yy_size_t yyleng_r;
|
||||||
char *yy_c_buf_p;
|
char *yy_c_buf_p;
|
||||||
int yy_init;
|
int yy_init;
|
||||||
int yy_start;
|
int yy_start;
|
||||||
@@ -900,7 +901,7 @@ FILE *yyget_out ( yyscan_t yyscanner );
|
|||||||
|
|
||||||
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
|
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
|
||||||
|
|
||||||
int yyget_leng ( yyscan_t yyscanner );
|
yy_size_t yyget_leng ( yyscan_t yyscanner );
|
||||||
|
|
||||||
char *yyget_text ( yyscan_t yyscanner );
|
char *yyget_text ( yyscan_t yyscanner );
|
||||||
|
|
||||||
@@ -985,7 +986,7 @@ static int input ( yyscan_t yyscanner );
|
|||||||
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
||||||
{ \
|
{ \
|
||||||
int c = '*'; \
|
int c = '*'; \
|
||||||
int n; \
|
yy_size_t n; \
|
||||||
for ( n = 0; n < max_size && \
|
for ( n = 0; n < max_size && \
|
||||||
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
|
||||||
buf[n] = (char) c; \
|
buf[n] = (char) c; \
|
||||||
@@ -1636,7 +1637,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int num_to_read =
|
yy_size_t num_to_read =
|
||||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
||||||
|
|
||||||
while ( num_to_read <= 0 )
|
while ( num_to_read <= 0 )
|
||||||
@@ -1650,7 +1651,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||||||
|
|
||||||
if ( b->yy_is_our_buffer )
|
if ( b->yy_is_our_buffer )
|
||||||
{
|
{
|
||||||
int new_size = b->yy_buf_size * 2;
|
yy_size_t new_size = b->yy_buf_size * 2;
|
||||||
|
|
||||||
if ( new_size <= 0 )
|
if ( new_size <= 0 )
|
||||||
b->yy_buf_size += b->yy_buf_size / 8;
|
b->yy_buf_size += b->yy_buf_size / 8;
|
||||||
@@ -1708,7 +1709,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||||||
|
|
||||||
if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
|
if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
|
||||||
/* Extend the array by 50%, plus the number we really need. */
|
/* Extend the array by 50%, plus the number we really need. */
|
||||||
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
|
yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
|
||||||
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
|
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
|
||||||
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
|
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
|
||||||
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
|
||||||
@@ -1815,7 +1816,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{ /* need more input */
|
{ /* need more input */
|
||||||
int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
|
yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
|
||||||
++yyg->yy_c_buf_p;
|
++yyg->yy_c_buf_p;
|
||||||
|
|
||||||
switch ( yy_get_next_buffer( yyscanner ) )
|
switch ( yy_get_next_buffer( yyscanner ) )
|
||||||
@@ -2193,12 +2194,12 @@ YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
|
|||||||
* @param yyscanner The scanner object.
|
* @param yyscanner The scanner object.
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
*/
|
*/
|
||||||
YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
|
YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
|
||||||
{
|
{
|
||||||
YY_BUFFER_STATE b;
|
YY_BUFFER_STATE b;
|
||||||
char *buf;
|
char *buf;
|
||||||
yy_size_t n;
|
yy_size_t n;
|
||||||
int i;
|
yy_size_t i;
|
||||||
|
|
||||||
/* Get memory for full buffer, including space for trailing EOB's. */
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
||||||
n = (yy_size_t) (_yybytes_len + 2);
|
n = (yy_size_t) (_yybytes_len + 2);
|
||||||
@@ -2283,7 +2284,7 @@ static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
|
|||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
/* Undo effects of setting up yytext. */ \
|
/* Undo effects of setting up yytext. */ \
|
||||||
int yyless_macro_arg = (n); \
|
yy_size_t yyless_macro_arg = (n); \
|
||||||
YY_LESS_LINENO(yyless_macro_arg);\
|
YY_LESS_LINENO(yyless_macro_arg);\
|
||||||
yytext[yyleng] = yyg->yy_hold_char; \
|
yytext[yyleng] = yyg->yy_hold_char; \
|
||||||
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
|
yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
|
||||||
@@ -2351,7 +2352,7 @@ FILE *yyget_out (yyscan_t yyscanner)
|
|||||||
/** Get the length of the current token.
|
/** Get the length of the current token.
|
||||||
* @param yyscanner The scanner object.
|
* @param yyscanner The scanner object.
|
||||||
*/
|
*/
|
||||||
int yyget_leng (yyscan_t yyscanner)
|
yy_size_t yyget_leng (yyscan_t yyscanner)
|
||||||
{
|
{
|
||||||
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
|
||||||
return yyleng;
|
return yyleng;
|
||||||
|
|||||||
+6
-5
@@ -2,9 +2,9 @@
|
|||||||
#define jq_yyHEADER_H 1
|
#define jq_yyHEADER_H 1
|
||||||
#define jq_yyIN_HEADER 1
|
#define jq_yyIN_HEADER 1
|
||||||
|
|
||||||
#line 6 "src/lexer.h"
|
#line 5 "src/lexer.h"
|
||||||
|
|
||||||
#line 8 "src/lexer.h"
|
#line 7 "src/lexer.h"
|
||||||
|
|
||||||
#define YY_INT_ALIGNED short int
|
#define YY_INT_ALIGNED short int
|
||||||
|
|
||||||
@@ -285,6 +285,7 @@ typedef int16_t flex_int16_t;
|
|||||||
typedef uint16_t flex_uint16_t;
|
typedef uint16_t flex_uint16_t;
|
||||||
typedef int32_t flex_int32_t;
|
typedef int32_t flex_int32_t;
|
||||||
typedef uint32_t flex_uint32_t;
|
typedef uint32_t flex_uint32_t;
|
||||||
|
typedef uint64_t flex_uint64_t;
|
||||||
#else
|
#else
|
||||||
typedef signed char flex_int8_t;
|
typedef signed char flex_int8_t;
|
||||||
typedef short int flex_int16_t;
|
typedef short int flex_int16_t;
|
||||||
@@ -398,7 +399,7 @@ struct yy_buffer_state
|
|||||||
/* Number of characters read into yy_ch_buf, not including EOB
|
/* Number of characters read into yy_ch_buf, not including EOB
|
||||||
* characters.
|
* characters.
|
||||||
*/
|
*/
|
||||||
int yy_n_chars;
|
yy_size_t yy_n_chars;
|
||||||
|
|
||||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||||
* and can realloc() it to grow it, and should free() it to
|
* and can realloc() it to grow it, and should free() it to
|
||||||
@@ -442,7 +443,7 @@ void yypop_buffer_state ( yyscan_t yyscanner );
|
|||||||
|
|
||||||
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
|
||||||
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
|
||||||
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
|
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner );
|
||||||
|
|
||||||
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
|
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
|
||||||
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
|
void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
|
||||||
@@ -500,7 +501,7 @@ FILE *yyget_out ( yyscan_t yyscanner );
|
|||||||
|
|
||||||
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
|
void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
|
||||||
|
|
||||||
int yyget_leng ( yyscan_t yyscanner );
|
yy_size_t yyget_leng ( yyscan_t yyscanner );
|
||||||
|
|
||||||
char *yyget_text ( yyscan_t yyscanner );
|
char *yyget_text ( yyscan_t yyscanner );
|
||||||
|
|
||||||
|
|||||||
+1598
-1311
File diff suppressed because it is too large.
Load diff
+71
-56
@@ -1,8 +1,9 @@
|
|||||||
/* A Bison parser, made by GNU Bison 3.0.4. */
|
/* A Bison parser, made by GNU Bison 3.8.2. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
|
Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
|
||||||
|
Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,7 +16,7 @@
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
/* As a special exception, you may create a larger work that contains
|
/* As a special exception, you may create a larger work that contains
|
||||||
part or all of the Bison parser skeleton and distribute that work
|
part or all of the Bison parser skeleton and distribute that work
|
||||||
@@ -30,6 +31,10 @@
|
|||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
|
/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
|
||||||
|
especially those whose name start with YY_ or yy_. They are
|
||||||
|
private implementation details that can be changed or removed. */
|
||||||
|
|
||||||
#ifndef YY_YY_SRC_PARSER_H_INCLUDED
|
#ifndef YY_YY_SRC_PARSER_H_INCLUDED
|
||||||
# define YY_YY_SRC_PARSER_H_INCLUDED
|
# define YY_YY_SRC_PARSER_H_INCLUDED
|
||||||
/* Debug traces. */
|
/* Debug traces. */
|
||||||
@@ -40,7 +45,7 @@
|
|||||||
extern int yydebug;
|
extern int yydebug;
|
||||||
#endif
|
#endif
|
||||||
/* "%code requires" blocks. */
|
/* "%code requires" blocks. */
|
||||||
#line 11 "src/parser.y" /* yacc.c:1909 */
|
#line 11 "src/parser.y"
|
||||||
|
|
||||||
#include "locfile.h"
|
#include "locfile.h"
|
||||||
struct lexer_param;
|
struct lexer_param;
|
||||||
@@ -57,61 +62,70 @@ struct lexer_param;
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#line 61 "src/parser.h" /* yacc.c:1909 */
|
#line 66 "src/parser.h"
|
||||||
|
|
||||||
/* Token type. */
|
/* Token kinds. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
enum yytokentype
|
enum yytokentype
|
||||||
{
|
{
|
||||||
INVALID_CHARACTER = 258,
|
YYEMPTY = -2,
|
||||||
IDENT = 259,
|
YYEOF = 0, /* "end of file" */
|
||||||
FIELD = 260,
|
YYerror = 256, /* error */
|
||||||
LITERAL = 261,
|
YYUNDEF = 257, /* "invalid token" */
|
||||||
FORMAT = 262,
|
INVALID_CHARACTER = 258, /* INVALID_CHARACTER */
|
||||||
REC = 263,
|
IDENT = 259, /* IDENT */
|
||||||
SETMOD = 264,
|
FIELD = 260, /* FIELD */
|
||||||
EQ = 265,
|
LITERAL = 261, /* LITERAL */
|
||||||
NEQ = 266,
|
FORMAT = 262, /* FORMAT */
|
||||||
DEFINEDOR = 267,
|
REC = 263, /* ".." */
|
||||||
AS = 268,
|
SETMOD = 264, /* "%=" */
|
||||||
DEF = 269,
|
EQ = 265, /* "==" */
|
||||||
MODULE = 270,
|
NEQ = 266, /* "!=" */
|
||||||
IMPORT = 271,
|
DEFINEDOR = 267, /* "//" */
|
||||||
INCLUDE = 272,
|
AS = 268, /* "as" */
|
||||||
IF = 273,
|
DEF = 269, /* "def" */
|
||||||
THEN = 274,
|
MODULE = 270, /* "module" */
|
||||||
ELSE = 275,
|
IMPORT = 271, /* "import" */
|
||||||
ELSE_IF = 276,
|
INCLUDE = 272, /* "include" */
|
||||||
REDUCE = 277,
|
IF = 273, /* "if" */
|
||||||
FOREACH = 278,
|
THEN = 274, /* "then" */
|
||||||
END = 279,
|
ELSE = 275, /* "else" */
|
||||||
AND = 280,
|
ELSE_IF = 276, /* "elif" */
|
||||||
OR = 281,
|
REDUCE = 277, /* "reduce" */
|
||||||
TRY = 282,
|
FOREACH = 278, /* "foreach" */
|
||||||
CATCH = 283,
|
END = 279, /* "end" */
|
||||||
LABEL = 284,
|
AND = 280, /* "and" */
|
||||||
BREAK = 285,
|
OR = 281, /* "or" */
|
||||||
LOC = 286,
|
TRY = 282, /* "try" */
|
||||||
SETPIPE = 287,
|
CATCH = 283, /* "catch" */
|
||||||
SETPLUS = 288,
|
LABEL = 284, /* "label" */
|
||||||
SETMINUS = 289,
|
BREAK = 285, /* "break" */
|
||||||
SETMULT = 290,
|
LOC = 286, /* "__loc__" */
|
||||||
SETDIV = 291,
|
SETPIPE = 287, /* "|=" */
|
||||||
SETDEFINEDOR = 292,
|
SETPLUS = 288, /* "+=" */
|
||||||
LESSEQ = 293,
|
SETMINUS = 289, /* "-=" */
|
||||||
GREATEREQ = 294,
|
SETMULT = 290, /* "*=" */
|
||||||
ALTERNATION = 295,
|
SETDIV = 291, /* "/=" */
|
||||||
QQSTRING_START = 296,
|
SETDEFINEDOR = 292, /* "//=" */
|
||||||
QQSTRING_TEXT = 297,
|
LESSEQ = 293, /* "<=" */
|
||||||
QQSTRING_INTERP_START = 298,
|
GREATEREQ = 294, /* ">=" */
|
||||||
QQSTRING_INTERP_END = 299,
|
ALTERNATION = 295, /* "?//" */
|
||||||
QQSTRING_END = 300,
|
QQSTRING_START = 296, /* QQSTRING_START */
|
||||||
FUNCDEF = 301,
|
QQSTRING_TEXT = 297, /* QQSTRING_TEXT */
|
||||||
NONOPT = 302
|
QQSTRING_INTERP_START = 298, /* QQSTRING_INTERP_START */
|
||||||
|
QQSTRING_INTERP_END = 299, /* QQSTRING_INTERP_END */
|
||||||
|
QQSTRING_END = 300, /* QQSTRING_END */
|
||||||
|
FUNCDEF = 301, /* FUNCDEF */
|
||||||
|
NONOPT = 302 /* NONOPT */
|
||||||
};
|
};
|
||||||
|
typedef enum yytokentype yytoken_kind_t;
|
||||||
#endif
|
#endif
|
||||||
/* Tokens. */
|
/* Token kinds. */
|
||||||
|
#define YYEMPTY -2
|
||||||
|
#define YYEOF 0
|
||||||
|
#define YYerror 256
|
||||||
|
#define YYUNDEF 257
|
||||||
#define INVALID_CHARACTER 258
|
#define INVALID_CHARACTER 258
|
||||||
#define IDENT 259
|
#define IDENT 259
|
||||||
#define FIELD 260
|
#define FIELD 260
|
||||||
@@ -160,17 +174,16 @@ struct lexer_param;
|
|||||||
|
|
||||||
/* Value type. */
|
/* Value type. */
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
|
|
||||||
union YYSTYPE
|
union YYSTYPE
|
||||||
{
|
{
|
||||||
#line 31 "src/parser.y" /* yacc.c:1909 */
|
#line 31 "src/parser.y"
|
||||||
|
|
||||||
jv literal;
|
jv literal;
|
||||||
block blk;
|
block blk;
|
||||||
|
|
||||||
#line 172 "src/parser.h" /* yacc.c:1909 */
|
#line 185 "src/parser.h"
|
||||||
};
|
|
||||||
|
|
||||||
|
};
|
||||||
typedef union YYSTYPE YYSTYPE;
|
typedef union YYSTYPE YYSTYPE;
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
@@ -192,6 +205,8 @@ struct YYLTYPE
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);
|
int yyparse (block* answer, int* errors, struct locfile* locations, struct lexer_param* lexer_param_ptr);
|
||||||
|
|
||||||
|
|
||||||
#endif /* !YY_YY_SRC_PARSER_H_INCLUDED */
|
#endif /* !YY_YY_SRC_PARSER_H_INCLUDED */
|
||||||
@@ -319,6 +319,10 @@ Module:
|
|||||||
FAIL(@$, "Module metadata must be constant");
|
FAIL(@$, "Module metadata must be constant");
|
||||||
$$ = gen_noop();
|
$$ = gen_noop();
|
||||||
block_free($2);
|
block_free($2);
|
||||||
|
} else if (block_const_kind($2) != JV_KIND_OBJECT) {
|
||||||
|
FAIL(@$, "Module metadata must be an object");
|
||||||
|
$$ = gen_noop();
|
||||||
|
block_free($2);
|
||||||
} else {
|
} else {
|
||||||
$$ = gen_module($2);
|
$$ = gen_module($2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1495,6 +1495,10 @@ null
|
|||||||
module (.+1); 0
|
module (.+1); 0
|
||||||
jq: error: Module metadata must be constant at <top-level>, line 1:
|
jq: error: Module metadata must be constant at <top-level>, line 1:
|
||||||
|
|
||||||
|
%%FAIL
|
||||||
|
module []; 0
|
||||||
|
jq: error: Module metadata must be an object at <top-level>, line 1:
|
||||||
|
|
||||||
%%FAIL
|
%%FAIL
|
||||||
include "a" (.+1); 0
|
include "a" (.+1); 0
|
||||||
jq: error: Module metadata must be constant at <top-level>, line 1:
|
jq: error: Module metadata must be constant at <top-level>, line 1:
|
||||||
|
|||||||
Reference in new issue
Block a user