[Forensics-changes] [yara] 159/368: More accurate line numbers in while reporting duplicate string identifier errors

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:23 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.5.0
in repository yara.

commit b9c4840fd40a5add8ef14025c6e853aaf169f94e
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Fri Jan 22 21:41:59 2016 +0100

    More accurate line numbers in while reporting duplicate string identifier errors
---
 libyara/grammar.c | 788 +++++++++++++++++++++++++++---------------------------
 libyara/grammar.y |  11 +-
 2 files changed, 409 insertions(+), 390 deletions(-)

diff --git a/libyara/grammar.c b/libyara/grammar.c
index 08d08cc..2aae078 100644
--- a/libyara/grammar.c
+++ b/libyara/grammar.c
@@ -507,16 +507,16 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  2
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   392
+#define YYLAST   390
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  72
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  40
+#define YYNNTS  41
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  119
+#define YYNRULES  120
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  206
+#define YYNSTATES  207
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -569,15 +569,16 @@ static const yytype_uint16 yyprhs[] =
        0,     0,     3,     4,     7,    10,    14,    18,    22,    25,
       26,    27,    39,    40,    44,    45,    49,    53,    54,    57,
       59,    61,    62,    65,    67,    70,    72,    75,    79,    83,
-      87,    91,    93,    96,   101,   102,   108,   112,   113,   116,
-     118,   120,   122,   124,   126,   130,   135,   140,   141,   143,
-     145,   149,   151,   153,   155,   157,   161,   165,   167,   171,
-     175,   176,   177,   189,   190,   200,   204,   207,   208,   213,
-     214,   219,   223,   227,   231,   235,   239,   243,   245,   249,
-     253,   255,   261,   263,   267,   268,   273,   275,   277,   281,
-     283,   285,   287,   289,   291,   295,   297,   299,   304,   306,
-     308,   310,   312,   317,   319,   324,   326,   328,   331,   335,
-     339,   343,   347,   351,   355,   359,   363,   366,   370,   374
+      87,    91,    93,    96,    97,   103,   104,   110,   114,   115,
+     118,   120,   122,   124,   126,   128,   132,   137,   142,   143,
+     145,   147,   151,   153,   155,   157,   159,   163,   167,   169,
+     173,   177,   178,   179,   191,   192,   202,   206,   209,   210,
+     215,   216,   221,   225,   229,   233,   237,   241,   245,   247,
+     251,   255,   257,   263,   265,   269,   270,   275,   277,   279,
+     283,   285,   287,   289,   291,   293,   297,   299,   301,   306,
+     308,   310,   312,   314,   319,   321,   326,   328,   330,   333,
+     337,   341,   345,   349,   353,   357,   361,   365,   368,   372,
+     376
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
@@ -588,39 +589,39 @@ static const yytype_int8 yyrhs[] =
       61,    -1,    37,    19,    -1,    -1,    -1,    81,     4,    10,
       76,    83,    62,    78,    79,    77,    80,    63,    -1,    -1,
        7,    64,    85,    -1,    -1,     8,    64,    87,    -1,     9,
-      64,    96,    -1,    -1,    81,    82,    -1,     5,    -1,     6,
+      64,    97,    -1,    -1,    81,    82,    -1,     5,    -1,     6,
       -1,    -1,    64,    84,    -1,    10,    -1,    84,    10,    -1,
       86,    -1,    85,    86,    -1,    10,    65,    19,    -1,    10,
       65,    16,    -1,    10,    65,    38,    -1,    10,    65,    39,
-      -1,    88,    -1,    87,    88,    -1,    11,    65,    19,    90,
-      -1,    -1,    11,    65,    89,    21,    90,    -1,    11,    65,
-      20,    -1,    -1,    90,    91,    -1,    23,    -1,    22,    -1,
-      24,    -1,    25,    -1,    10,    -1,    92,    66,    10,    -1,
-      92,    67,   111,    68,    -1,    92,    69,    93,    70,    -1,
-      -1,    94,    -1,    97,    -1,    94,    71,    97,    -1,    21,
-      -1,    97,    -1,    38,    -1,    39,    -1,   111,    35,    95,
-      -1,   111,    36,   111,    -1,    11,    -1,    11,    26,   111,
-      -1,    11,    31,   104,    -1,    -1,    -1,    33,   110,    10,
-      31,    98,   103,    64,    99,    69,    96,    70,    -1,    -1,
-      33,   110,    32,   106,    64,   100,    69,    96,    70,    -1,
-     110,    32,   106,    -1,    60,    96,    -1,    -1,    96,    41,
-     101,    96,    -1,    -1,    96,    40,   102,    96,    -1,   111,
-      50,   111,    -1,   111,    48,   111,    -1,   111,    49,   111,
-      -1,   111,    47,   111,    -1,   111,    46,   111,    -1,   111,
-      45,   111,    -1,   111,    -1,    69,    97,    70,    -1,    69,
-     105,    70,    -1,   104,    -1,    69,   111,     3,   111,    70,
-      -1,   111,    -1,   105,    71,   111,    -1,    -1,    69,   107,
-     108,    70,    -1,    34,    -1,   109,    -1,   108,    71,   109,
-      -1,    11,    -1,    15,    -1,   111,    -1,    29,    -1,    30,
-      -1,    69,   111,    70,    -1,    27,    -1,    28,    -1,    18,
-      69,   111,    70,    -1,    16,    -1,    17,    -1,    19,    -1,
-      12,    -1,    13,    67,   111,    68,    -1,    13,    -1,    14,
-      67,   111,    68,    -1,    14,    -1,    92,    -1,    54,   111,
-      -1,   111,    53,   111,    -1,   111,    54,   111,    -1,   111,
-      55,   111,    -1,   111,    56,   111,    -1,   111,    57,   111,
-      -1,   111,    43,   111,    -1,   111,    44,   111,    -1,   111,
-      42,   111,    -1,    58,   111,    -1,   111,    52,   111,    -1,
-     111,    51,   111,    -1,    95,    -1
+      -1,    88,    -1,    87,    88,    -1,    -1,    11,    65,    89,
+      19,    91,    -1,    -1,    11,    65,    90,    21,    91,    -1,
+      11,    65,    20,    -1,    -1,    91,    92,    -1,    23,    -1,
+      22,    -1,    24,    -1,    25,    -1,    10,    -1,    93,    66,
+      10,    -1,    93,    67,   112,    68,    -1,    93,    69,    94,
+      70,    -1,    -1,    95,    -1,    98,    -1,    95,    71,    98,
+      -1,    21,    -1,    98,    -1,    38,    -1,    39,    -1,   112,
+      35,    96,    -1,   112,    36,   112,    -1,    11,    -1,    11,
+      26,   112,    -1,    11,    31,   105,    -1,    -1,    -1,    33,
+     111,    10,    31,    99,   104,    64,   100,    69,    97,    70,
+      -1,    -1,    33,   111,    32,   107,    64,   101,    69,    97,
+      70,    -1,   111,    32,   107,    -1,    60,    97,    -1,    -1,
+      97,    41,   102,    97,    -1,    -1,    97,    40,   103,    97,
+      -1,   112,    50,   112,    -1,   112,    48,   112,    -1,   112,
+      49,   112,    -1,   112,    47,   112,    -1,   112,    46,   112,
+      -1,   112,    45,   112,    -1,   112,    -1,    69,    98,    70,
+      -1,    69,   106,    70,    -1,   105,    -1,    69,   112,     3,
+     112,    70,    -1,   112,    -1,   106,    71,   112,    -1,    -1,
+      69,   108,   109,    70,    -1,    34,    -1,   110,    -1,   109,
+      71,   110,    -1,    11,    -1,    15,    -1,   112,    -1,    29,
+      -1,    30,    -1,    69,   112,    70,    -1,    27,    -1,    28,
+      -1,    18,    69,   112,    70,    -1,    16,    -1,    17,    -1,
+      19,    -1,    12,    -1,    13,    67,   112,    68,    -1,    13,
+      -1,    14,    67,   112,    68,    -1,    14,    -1,    93,    -1,
+      54,   112,    -1,   112,    53,   112,    -1,   112,    54,   112,
+      -1,   112,    55,   112,    -1,   112,    56,   112,    -1,   112,
+      57,   112,    -1,   112,    43,   112,    -1,   112,    44,   112,
+      -1,   112,    42,   112,    -1,    58,   112,    -1,   112,    52,
+     112,    -1,   112,    51,   112,    -1,    96,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -629,15 +630,16 @@ static const yytype_uint16 yyrline[] =
        0,   200,   200,   202,   203,   204,   205,   206,   211,   224,
      233,   223,   256,   259,   287,   290,   317,   322,   323,   328,
      329,   335,   338,   356,   369,   406,   407,   412,   428,   441,
-     454,   471,   472,   477,   488,   487,   503,   517,   518,   523,
-     524,   525,   526,   531,   616,   662,   720,   765,   766,   770,
-     795,   831,   877,   892,   901,   910,   925,   937,   951,   964,
-     976,  1006,   975,  1122,  1121,  1201,  1207,  1214,  1213,  1276,
-    1275,  1336,  1345,  1354,  1363,  1372,  1381,  1390,  1394,  1402,
-    1403,  1408,  1430,  1442,  1458,  1457,  1463,  1474,  1475,  1480,
-    1487,  1498,  1499,  1503,  1511,  1515,  1525,  1539,  1555,  1565,
-    1574,  1598,  1610,  1622,  1638,  1650,  1666,  1710,  1729,  1747,
-    1765,  1783,  1809,  1827,  1837,  1847,  1857,  1867,  1877,  1887
+     454,   471,   472,   478,   477,   493,   492,   507,   522,   523,
+     528,   529,   530,   531,   536,   621,   667,   725,   770,   771,
+     775,   800,   836,   882,   897,   906,   915,   930,   942,   956,
+     969,   981,  1011,   980,  1127,  1126,  1206,  1212,  1219,  1218,
+    1281,  1280,  1341,  1350,  1359,  1368,  1377,  1386,  1395,  1399,
+    1407,  1408,  1413,  1435,  1447,  1463,  1462,  1468,  1479,  1480,
+    1485,  1492,  1503,  1504,  1508,  1516,  1520,  1530,  1544,  1560,
+    1570,  1579,  1603,  1615,  1627,  1643,  1655,  1671,  1715,  1734,
+    1752,  1770,  1788,  1814,  1832,  1842,  1852,  1862,  1872,  1882,
+    1892
 };
 #endif
 
@@ -661,10 +663,10 @@ static const char *const yytname[] =
   "rules", "import", "rule", "@1", "@2", "meta", "strings", "condition",
   "rule_modifiers", "rule_modifier", "tags", "tag_list",
   "meta_declarations", "meta_declaration", "string_declarations",
-  "string_declaration", "@3", "string_modifiers", "string_modifier",
+  "string_declaration", "@3", "@4", "string_modifiers", "string_modifier",
   "identifier", "arguments", "arguments_list", "regexp",
-  "boolean_expression", "expression", "@4", "@5", "@6", "@7", "@8",
-  "integer_set", "range", "integer_enumeration", "string_set", "@9",
+  "boolean_expression", "expression", "@5", "@6", "@7", "@8", "@9",
+  "integer_set", "range", "integer_enumeration", "string_set", "@10",
   "string_enumeration", "string_enumeration_item", "for_expression",
   "primary_expression", 0
 };
@@ -692,15 +694,16 @@ static const yytype_uint8 yyr1[] =
        0,    72,    73,    73,    73,    73,    73,    73,    74,    76,
       77,    75,    78,    78,    79,    79,    80,    81,    81,    82,
       82,    83,    83,    84,    84,    85,    85,    86,    86,    86,
-      86,    87,    87,    88,    89,    88,    88,    90,    90,    91,
-      91,    91,    91,    92,    92,    92,    92,    93,    93,    94,
-      94,    95,    96,    97,    97,    97,    97,    97,    97,    97,
-      98,    99,    97,   100,    97,    97,    97,   101,    97,   102,
-      97,    97,    97,    97,    97,    97,    97,    97,    97,   103,
-     103,   104,   105,   105,   107,   106,   106,   108,   108,   109,
-     109,   110,   110,   110,   111,   111,   111,   111,   111,   111,
-     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
-     111,   111,   111,   111,   111,   111,   111,   111,   111,   111
+      86,    87,    87,    89,    88,    90,    88,    88,    91,    91,
+      92,    92,    92,    92,    93,    93,    93,    93,    94,    94,
+      95,    95,    96,    97,    98,    98,    98,    98,    98,    98,
+      98,    99,   100,    98,   101,    98,    98,    98,   102,    98,
+     103,    98,    98,    98,    98,    98,    98,    98,    98,    98,
+     104,   104,   105,   106,   106,   108,   107,   107,   109,   109,
+     110,   110,   111,   111,   111,   112,   112,   112,   112,   112,
+     112,   112,   112,   112,   112,   112,   112,   112,   112,   112,
+     112,   112,   112,   112,   112,   112,   112,   112,   112,   112,
+     112
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -709,15 +712,16 @@ static const yytype_uint8 yyr2[] =
        0,     2,     0,     2,     2,     3,     3,     3,     2,     0,
        0,    11,     0,     3,     0,     3,     3,     0,     2,     1,
        1,     0,     2,     1,     2,     1,     2,     3,     3,     3,
-       3,     1,     2,     4,     0,     5,     3,     0,     2,     1,
-       1,     1,     1,     1,     3,     4,     4,     0,     1,     1,
-       3,     1,     1,     1,     1,     3,     3,     1,     3,     3,
-       0,     0,    11,     0,     9,     3,     2,     0,     4,     0,
-       4,     3,     3,     3,     3,     3,     3,     1,     3,     3,
-       1,     5,     1,     3,     0,     4,     1,     1,     3,     1,
-       1,     1,     1,     1,     3,     1,     1,     4,     1,     1,
-       1,     1,     4,     1,     4,     1,     1,     2,     3,     3,
-       3,     3,     3,     3,     3,     3,     2,     3,     3,     1
+       3,     1,     2,     0,     5,     0,     5,     3,     0,     2,
+       1,     1,     1,     1,     1,     3,     4,     4,     0,     1,
+       1,     3,     1,     1,     1,     1,     3,     3,     1,     3,
+       3,     0,     0,    11,     0,     9,     3,     2,     0,     4,
+       0,     4,     3,     3,     3,     3,     3,     3,     1,     3,
+       3,     1,     5,     1,     3,     0,     4,     1,     1,     3,
+       1,     1,     1,     1,     1,     3,     1,     1,     4,     1,
+       1,     1,     1,     4,     1,     4,     1,     1,     2,     3,
+       3,     3,     3,     3,     3,     3,     3,     2,     3,     3,
+       1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -729,32 +733,33 @@ static const yytype_uint8 yydefact[] =
        5,     8,     0,    19,    20,    18,     9,    21,     0,     0,
       23,    22,    12,    24,     0,    14,     0,     0,    10,     0,
       13,    25,     0,     0,     0,    26,     0,    15,    31,     0,
-       0,    28,    27,    29,    30,    34,    32,     0,    11,    37,
-      36,     0,    43,    57,   101,   103,   105,    98,    99,     0,
-     100,    51,    95,    96,    92,    93,     0,    53,    54,     0,
-       0,     0,     0,   106,   119,    16,    52,     0,    77,    33,
-      37,     0,     0,     0,     0,     0,     0,     0,    91,   107,
-     116,    66,     0,    52,    77,     0,     0,    47,    69,    67,
+       0,    28,    27,    29,    30,    33,    32,     0,    11,    37,
+       0,     0,    44,    58,   102,   104,   106,    99,   100,     0,
+     101,    52,    96,    97,    93,    94,     0,    54,    55,     0,
+       0,     0,     0,   107,   120,    16,    53,     0,    78,    38,
+      38,     0,     0,     0,     0,     0,     0,     0,    92,   108,
+     117,    67,     0,    53,    78,     0,     0,    48,    70,    68,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,     0,     0,     0,     0,     0,     0,    40,
-      39,    41,    42,    38,    35,    58,     0,    59,     0,     0,
-       0,     0,     0,     0,    78,    94,    44,     0,     0,    48,
-      49,     0,     0,    86,    84,    65,    55,    56,   115,   113,
-     114,    76,    75,    74,    72,    73,    71,   118,   117,   108,
-     109,   110,   111,   112,     0,   102,   104,    97,    60,     0,
-      45,    46,     0,    70,    68,     0,     0,     0,    63,    50,
-      89,    90,     0,    87,     0,     0,     0,    80,     0,    85,
-       0,    81,     0,    82,    61,     0,    88,    79,     0,     0,
-       0,    83,     0,    64,     0,    62
+       0,     0,     0,     0,     0,     0,     0,     0,     0,    34,
+      36,    59,     0,    60,     0,     0,     0,     0,     0,     0,
+      79,    95,    45,     0,     0,    49,    50,     0,     0,    87,
+      85,    66,    56,    57,   116,   114,   115,    77,    76,    75,
+      73,    74,    72,   119,   118,   109,   110,   111,   112,   113,
+      41,    40,    42,    43,    39,     0,   103,   105,    98,    61,
+       0,    46,    47,     0,    71,    69,     0,     0,     0,    64,
+      51,    90,    91,     0,    88,     0,     0,     0,    81,     0,
+      86,     0,    82,     0,    83,    62,     0,    89,    80,     0,
+       0,     0,    84,     0,    65,     0,    63
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
       -1,     1,     5,     6,    17,    33,    25,    28,    40,     7,
-      15,    19,    21,    30,    31,    37,    38,    51,    79,   123,
-      73,   138,   139,    74,    92,    76,   177,   199,   188,   142,
-     141,   186,   127,   192,   145,   175,   182,   183,    77,    78
+      15,    19,    21,    30,    31,    37,    38,    50,    51,   119,
+     164,    73,   134,   135,    74,    92,    76,   178,   200,   189,
+     138,   137,   187,   123,   193,   141,   176,   183,   184,    77,
+      78
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -762,129 +767,130 @@ static const yytype_int16 yydefgoto[] =
 #define YYPACT_NINF -71
 static const yytype_int16 yypact[] =
 {
-     -71,    29,   -71,   -29,   -16,   -71,   -71,   166,   -71,   -71,
-     -71,   -71,    13,   -71,   -71,   -71,   -71,   -10,    60,    10,
-     -71,    91,    71,   -71,    16,    95,   121,    41,   -71,    42,
-     121,   -71,   126,   133,    70,   -71,    94,   126,   -71,   111,
-     114,   -71,   -71,   -71,   -71,    63,   -71,    46,   -71,   -71,
-     -71,   157,   -71,    -9,   -71,   115,   119,   -71,   -71,   112,
-     -71,   -71,   -71,   -71,   -71,   -71,   100,   -71,   -71,   122,
-     122,    46,    46,    30,   -71,    47,   -71,   155,   290,    68,
-     -71,   122,   120,   122,   122,   122,   122,    -4,   306,   -71,
-     -71,   -71,    47,   118,   167,   180,   122,    46,   -71,   -71,
-       2,   179,   122,   122,   122,   122,   122,   122,   122,   122,
-     122,   122,   122,   122,   122,   122,   122,   122,   122,   -71,
-     -71,   -71,   -71,   -71,    68,   306,   122,   -71,   227,   245,
-     109,   187,   170,     2,   -71,   -71,   -71,   263,   134,   135,
-     116,    46,    46,   -71,   -71,   -71,   -71,   306,   321,   335,
-     -42,   306,   306,   306,   306,   306,   306,    69,    69,    90,
-      90,   -71,   -71,   -71,   141,   -71,   -71,   -71,   -71,   143,
-     -71,   -71,    46,   164,   -71,    66,   122,   139,   -71,   116,
-     -71,   -71,    97,   -71,   207,   122,   161,   -71,   158,   -71,
-      66,   -71,   103,   141,   -71,    46,   -71,   -71,   122,   159,
-     -15,   306,    46,   -71,    28,   -71
+     -71,   157,   -71,   -31,    -7,   -71,   -71,    68,   -71,   -71,
+     -71,   -71,     5,   -71,   -71,   -71,   -71,   -10,     7,   -33,
+     -71,    46,    61,   -71,    35,    93,   112,    59,   -71,    63,
+     112,   -71,   128,   139,    -5,   -71,    85,   128,   -71,    89,
+      91,   -71,   -71,   -71,   -71,     2,   -71,    48,   -71,   -71,
+     133,   138,   -71,   -23,   -71,    98,   100,   -71,   -71,    95,
+     -71,   -71,   -71,   -71,   -71,   -71,    97,   -71,   -71,   119,
+     119,    48,    48,    13,   -71,    64,   -71,   140,   297,   -71,
+     -71,   119,    99,   119,   119,   119,   119,     0,    41,   -71,
+     -71,   -71,    64,    90,   154,   164,   119,    48,   -71,   -71,
+      -6,   155,   119,   119,   119,   119,   119,   119,   119,   119,
+     119,   119,   119,   119,   119,   119,   119,   119,   119,   190,
+     190,    41,   119,   -71,   234,   252,   174,   194,   144,    -6,
+     -71,   -71,   -71,   270,   115,   116,    79,    48,    48,   -71,
+     -71,   -71,   -71,    41,   312,   326,   333,    41,    41,    41,
+      41,    41,    41,    88,    88,   136,   136,   -71,   -71,   -71,
+     -71,   -71,   -71,   -71,   -71,   127,   -71,   -71,   -71,   -71,
+     131,   -71,   -71,    48,   178,   -71,    -2,   119,   151,   -71,
+      79,   -71,   -71,   -35,   -71,   214,   119,   158,   -71,   152,
+     -71,    -2,   -71,    18,   127,   -71,    48,   -71,   -71,   119,
+     163,   -15,    41,    48,   -71,    30,   -71
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-     -71,   -71,   223,   229,   -71,   -71,   -71,   -71,   -71,   -71,
-     -71,   -71,   -71,   -71,   203,   -71,   197,   -71,   156,   -71,
-     -71,   -71,   -71,   144,   -47,   -70,   -71,   -71,   -71,   -71,
-     -71,   -71,    58,   -71,   113,   -71,   -71,    57,   182,   -65
+     -71,   -71,   220,   230,   -71,   -71,   -71,   -71,   -71,   -71,
+     -71,   -71,   -71,   -71,   204,   -71,   198,   -71,   -71,   159,
+     -71,   -71,   -71,   -71,   141,   -47,   -70,   -71,   -71,   -71,
+     -71,   -71,   -71,    62,   -71,   114,   -71,   -71,    50,   186,
+     -65
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -92
+#define YYTABLE_NINF -93
 static const yytype_int16 yytable[] =
 {
-      75,    88,    93,    11,    89,    90,   132,    94,     4,   112,
-     113,   114,   115,   116,   117,   118,   125,    81,   128,   129,
-     130,   131,    82,    16,    91,    98,    99,   140,   133,     2,
-       3,   137,     8,   -17,   -17,   -17,   143,   147,   148,   149,
-     150,   151,   152,   153,   154,   155,   156,   157,   158,   159,
-     160,   161,   162,   163,    18,   203,    52,    53,    54,    55,
-      56,   164,    57,    58,    59,    60,     4,    61,    98,    99,
-      20,   144,    22,    62,    63,    64,    65,   180,    24,    66,
-      26,   181,    49,    50,    67,    68,    41,    98,    99,    42,
-     119,   120,   121,   122,   173,   174,    95,    96,   205,    97,
-      69,    23,   179,    27,    70,    32,    71,    34,    43,    44,
-      52,   184,    54,    55,    56,    72,    57,    58,    59,    60,
-     193,    61,   114,   115,   116,   117,   118,    62,    63,    64,
-      65,    29,    52,   201,    54,    55,    56,    36,    57,    58,
-      59,    60,    39,    61,   176,   116,   117,   118,   200,    62,
-      63,   103,   104,   105,    69,   204,   -52,   -52,    70,    45,
-     112,   113,   114,   115,   116,   117,   118,   189,   190,    86,
-      12,    13,    14,   197,   198,    47,    69,    48,    80,   167,
-      70,    85,    83,   103,   104,   105,    84,   100,   134,   126,
-     136,    86,   112,   113,   114,   115,   116,   117,   118,   -91,
-      61,   168,   101,   102,   171,    99,   172,   178,   185,   103,
+      75,    88,    93,    81,    89,    90,     4,    94,    82,   181,
+     128,    41,    11,   182,    42,    16,   121,    20,   124,   125,
+     126,   127,    49,   -35,    91,    98,    99,   136,   139,    22,
+       8,   133,   129,    43,    44,   190,   191,   143,   144,   145,
+     146,   147,   148,   149,   150,   151,   152,   153,   154,   155,
+     156,   157,   158,   159,    18,   204,    23,   165,    52,    53,
+      54,    55,    56,   140,    57,    58,    59,    60,    24,    61,
+      98,    99,    12,    13,    14,    62,    63,    64,    65,    95,
+      96,    66,    97,   103,   104,   105,    67,    68,   198,   199,
+     174,   175,   112,   113,   114,   115,   116,   117,   118,    26,
+     206,    27,    69,   180,    98,    99,    70,    52,    71,    54,
+      55,    56,   185,    57,    58,    59,    60,    72,    61,   -53,
+     -53,   194,    29,    32,    62,    63,    64,    65,    34,    52,
+     177,    54,    55,    56,   202,    57,    58,    59,    60,    36,
+      61,   114,   115,   116,   117,   118,    62,    63,    39,   201,
+      45,    69,    79,    47,    48,    70,   205,     2,     3,    80,
+     130,   -17,   -17,   -17,    85,    83,    86,    84,   122,   103,
+     104,   105,   100,    69,   132,   169,    61,    70,   112,   113,
+     114,   115,   116,   117,   118,   172,   -92,   173,    86,   101,
+     102,   116,   117,   118,     4,   179,   103,   104,   105,   106,
+     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
+     117,   118,   160,   161,   162,   163,   103,   104,   105,    99,
+     186,   196,   195,     9,   131,   112,   113,   114,   115,   116,
+     117,   118,   203,    10,    35,    46,   103,   104,   105,   120,
+     188,   197,   142,   170,   168,   112,   113,   114,   115,   116,
+     117,   118,    87,     0,     0,     0,   103,   104,   105,     0,
+       0,     0,     0,     0,   131,   112,   113,   114,   115,   116,
+     117,   118,     0,     0,     0,     0,   103,   104,   105,     0,
+       0,     0,     0,     0,   192,   112,   113,   114,   115,   116,
+     117,   118,     0,     0,   103,   104,   105,     0,     0,     0,
+       0,     0,   166,   112,   113,   114,   115,   116,   117,   118,
+       0,     0,   103,   104,   105,     0,     0,     0,     0,     0,
+     167,   112,   113,   114,   115,   116,   117,   118,     0,   -92,
+       0,     0,   101,   102,     0,     0,     0,     0,   171,   103,
      104,   105,   106,   107,   108,   109,   110,   111,   112,   113,
-     114,   115,   116,   117,   118,   194,     9,   195,   202,   103,
-     104,   105,    10,    35,    46,   187,   124,   135,   112,   113,
-     114,   115,   116,   117,   118,   146,   169,   196,    87,   103,
-     104,   105,     0,     0,     0,     0,     0,   135,   112,   113,
-     114,   115,   116,   117,   118,     0,     0,     0,     0,   103,
-     104,   105,     0,     0,     0,     0,     0,   191,   112,   113,
-     114,   115,   116,   117,   118,     0,     0,   103,   104,   105,
-       0,     0,     0,     0,     0,   165,   112,   113,   114,   115,
-     116,   117,   118,     0,     0,   103,   104,   105,     0,     0,
-       0,     0,     0,   166,   112,   113,   114,   115,   116,   117,
-     118,     0,   -91,     0,     0,   101,   102,     0,     0,     0,
-       0,   170,   103,   104,   105,   106,   107,   108,   109,   110,
-     111,   112,   113,   114,   115,   116,   117,   118,   103,   104,
+     114,   115,   116,   117,   118,   104,   105,     0,     0,     0,
+       0,     0,     0,   112,   113,   114,   115,   116,   117,   118,
      105,     0,     0,     0,     0,     0,     0,   112,   113,   114,
-     115,   116,   117,   118,   104,   105,     0,     0,     0,     0,
-       0,     0,   112,   113,   114,   115,   116,   117,   118,   105,
-       0,     0,     0,     0,     0,     0,   112,   113,   114,   115,
-     116,   117,   118
+     115,   116,   117,   118,   112,   113,   114,   115,   116,   117,
+     118
 };
 
 static const yytype_int16 yycheck[] =
 {
-      47,    66,    72,    19,    69,    70,    10,    72,    37,    51,
-      52,    53,    54,    55,    56,    57,    81,    26,    83,    84,
-      85,    86,    31,    10,    71,    40,    41,    97,    32,     0,
-       1,    96,    61,     4,     5,     6,    34,   102,   103,   104,
+      47,    66,    72,    26,    69,    70,    37,    72,    31,    11,
+      10,    16,    19,    15,    19,    10,    81,    10,    83,    84,
+      85,    86,    20,    21,    71,    40,    41,    97,    34,    62,
+      61,    96,    32,    38,    39,    70,    71,   102,   103,   104,
      105,   106,   107,   108,   109,   110,   111,   112,   113,   114,
-     115,   116,   117,   118,    64,    70,    10,    11,    12,    13,
-      14,   126,    16,    17,    18,    19,    37,    21,    40,    41,
-      10,    69,    62,    27,    28,    29,    30,    11,     7,    33,
-      64,    15,    19,    20,    38,    39,    16,    40,    41,    19,
-      22,    23,    24,    25,   141,   142,    66,    67,    70,    69,
-      54,    10,   172,     8,    58,    64,    60,    65,    38,    39,
-      10,   176,    12,    13,    14,    69,    16,    17,    18,    19,
-     185,    21,    53,    54,    55,    56,    57,    27,    28,    29,
-      30,    10,    10,   198,    12,    13,    14,    11,    16,    17,
-      18,    19,     9,    21,     3,    55,    56,    57,   195,    27,
-      28,    42,    43,    44,    54,   202,    40,    41,    58,    65,
-      51,    52,    53,    54,    55,    56,    57,    70,    71,    69,
-       4,     5,     6,    70,    71,    64,    54,    63,    21,    70,
-      58,    69,    67,    42,    43,    44,    67,    32,    70,    69,
-      10,    69,    51,    52,    53,    54,    55,    56,    57,    32,
-      21,    31,    35,    36,    70,    41,    71,    64,    69,    42,
+     115,   116,   117,   118,    64,    70,    10,   122,    10,    11,
+      12,    13,    14,    69,    16,    17,    18,    19,     7,    21,
+      40,    41,     4,     5,     6,    27,    28,    29,    30,    66,
+      67,    33,    69,    42,    43,    44,    38,    39,    70,    71,
+     137,   138,    51,    52,    53,    54,    55,    56,    57,    64,
+      70,     8,    54,   173,    40,    41,    58,    10,    60,    12,
+      13,    14,   177,    16,    17,    18,    19,    69,    21,    40,
+      41,   186,    10,    64,    27,    28,    29,    30,    65,    10,
+       3,    12,    13,    14,   199,    16,    17,    18,    19,    11,
+      21,    53,    54,    55,    56,    57,    27,    28,     9,   196,
+      65,    54,    19,    64,    63,    58,   203,     0,     1,    21,
+      70,     4,     5,     6,    69,    67,    69,    67,    69,    42,
+      43,    44,    32,    54,    10,    31,    21,    58,    51,    52,
+      53,    54,    55,    56,    57,    70,    32,    71,    69,    35,
+      36,    55,    56,    57,    37,    64,    42,    43,    44,    45,
+      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
+      56,    57,    22,    23,    24,    25,    42,    43,    44,    41,
+      69,    69,    64,     3,    70,    51,    52,    53,    54,    55,
+      56,    57,    69,     3,    30,    37,    42,    43,    44,    80,
+     178,   191,   101,   129,    70,    51,    52,    53,    54,    55,
+      56,    57,    66,    -1,    -1,    -1,    42,    43,    44,    -1,
+      -1,    -1,    -1,    -1,    70,    51,    52,    53,    54,    55,
+      56,    57,    -1,    -1,    -1,    -1,    42,    43,    44,    -1,
+      -1,    -1,    -1,    -1,    70,    51,    52,    53,    54,    55,
+      56,    57,    -1,    -1,    42,    43,    44,    -1,    -1,    -1,
+      -1,    -1,    68,    51,    52,    53,    54,    55,    56,    57,
+      -1,    -1,    42,    43,    44,    -1,    -1,    -1,    -1,    -1,
+      68,    51,    52,    53,    54,    55,    56,    57,    -1,    32,
+      -1,    -1,    35,    36,    -1,    -1,    -1,    -1,    68,    42,
       43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
-      53,    54,    55,    56,    57,    64,     3,    69,    69,    42,
-      43,    44,     3,    30,    37,   177,    80,    70,    51,    52,
-      53,    54,    55,    56,    57,   101,   133,   190,    66,    42,
-      43,    44,    -1,    -1,    -1,    -1,    -1,    70,    51,    52,
-      53,    54,    55,    56,    57,    -1,    -1,    -1,    -1,    42,
-      43,    44,    -1,    -1,    -1,    -1,    -1,    70,    51,    52,
-      53,    54,    55,    56,    57,    -1,    -1,    42,    43,    44,
-      -1,    -1,    -1,    -1,    -1,    68,    51,    52,    53,    54,
-      55,    56,    57,    -1,    -1,    42,    43,    44,    -1,    -1,
-      -1,    -1,    -1,    68,    51,    52,    53,    54,    55,    56,
-      57,    -1,    32,    -1,    -1,    35,    36,    -1,    -1,    -1,
-      -1,    68,    42,    43,    44,    45,    46,    47,    48,    49,
-      50,    51,    52,    53,    54,    55,    56,    57,    42,    43,
+      53,    54,    55,    56,    57,    43,    44,    -1,    -1,    -1,
+      -1,    -1,    -1,    51,    52,    53,    54,    55,    56,    57,
       44,    -1,    -1,    -1,    -1,    -1,    -1,    51,    52,    53,
-      54,    55,    56,    57,    43,    44,    -1,    -1,    -1,    -1,
-      -1,    -1,    51,    52,    53,    54,    55,    56,    57,    44,
-      -1,    -1,    -1,    -1,    -1,    -1,    51,    52,    53,    54,
-      55,    56,    57
+      54,    55,    56,    57,    51,    52,    53,    54,    55,    56,
+      57
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -895,23 +901,23 @@ static const yytype_uint8 yystos[] =
       75,    19,     4,     5,     6,    82,    10,    76,    64,    83,
       10,    84,    62,    10,     7,    78,    64,     8,    79,    10,
       85,    86,    64,    77,    65,    86,    11,    87,    88,     9,
-      80,    16,    19,    38,    39,    65,    88,    64,    63,    19,
-      20,    89,    10,    11,    12,    13,    14,    16,    17,    18,
+      80,    16,    19,    38,    39,    65,    88,    64,    63,    20,
+      89,    90,    10,    11,    12,    13,    14,    16,    17,    18,
       19,    21,    27,    28,    29,    30,    33,    38,    39,    54,
-      58,    60,    69,    92,    95,    96,    97,   110,   111,    90,
-      21,    26,    31,    67,    67,    69,    69,   110,   111,   111,
-     111,    96,    96,    97,   111,    66,    67,    69,    40,    41,
+      58,    60,    69,    93,    96,    97,    98,   111,   112,    19,
+      21,    26,    31,    67,    67,    69,    69,   111,   112,   112,
+     112,    97,    97,    98,   112,    66,    67,    69,    40,    41,
       32,    35,    36,    42,    43,    44,    45,    46,    47,    48,
-      49,    50,    51,    52,    53,    54,    55,    56,    57,    22,
-      23,    24,    25,    91,    90,   111,    69,   104,   111,   111,
-     111,   111,    10,    32,    70,    70,    10,   111,    93,    94,
-      97,   102,   101,    34,    69,   106,    95,   111,   111,   111,
-     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
-     111,   111,   111,   111,   111,    68,    68,    70,    31,   106,
-      68,    70,    71,    96,    96,   107,     3,    98,    64,    97,
-      11,    15,   108,   109,   111,    69,   103,   104,   100,    70,
-      71,    70,   105,   111,    64,    69,   109,    70,    71,    99,
-      96,   111,    69,    70,    96,    70
+      49,    50,    51,    52,    53,    54,    55,    56,    57,    91,
+      91,   112,    69,   105,   112,   112,   112,   112,    10,    32,
+      70,    70,    10,   112,    94,    95,    98,   103,   102,    34,
+      69,   107,    96,   112,   112,   112,   112,   112,   112,   112,
+     112,   112,   112,   112,   112,   112,   112,   112,   112,   112,
+      22,    23,    24,    25,    92,   112,    68,    68,    70,    31,
+     107,    68,    70,    71,    97,    97,   108,     3,    99,    64,
+      98,    11,    15,   109,   110,   112,    69,   104,   105,   101,
+      70,    71,    70,   106,   112,    64,    69,   110,    70,    71,
+     100,    97,   112,    69,    70,    97,    70
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1434,47 +1440,47 @@ yydestruct (yymsg, yytype, yyvaluep, yyscanner, compiler)
       case 10: /* "_IDENTIFIER_" */
 #line 176 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1438 "grammar.c"
+#line 1444 "grammar.c"
 	break;
       case 11: /* "_STRING_IDENTIFIER_" */
 #line 180 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1443 "grammar.c"
+#line 1449 "grammar.c"
 	break;
       case 12: /* "_STRING_COUNT_" */
 #line 177 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1448 "grammar.c"
+#line 1454 "grammar.c"
 	break;
       case 13: /* "_STRING_OFFSET_" */
 #line 178 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1453 "grammar.c"
+#line 1459 "grammar.c"
 	break;
       case 14: /* "_STRING_LENGTH_" */
 #line 179 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1458 "grammar.c"
+#line 1464 "grammar.c"
 	break;
       case 15: /* "_STRING_IDENTIFIER_WITH_WILDCARD_" */
 #line 181 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1463 "grammar.c"
+#line 1469 "grammar.c"
 	break;
       case 19: /* "_TEXT_STRING_" */
 #line 182 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1468 "grammar.c"
+#line 1474 "grammar.c"
 	break;
       case 20: /* "_HEX_STRING_" */
 #line 183 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1473 "grammar.c"
+#line 1479 "grammar.c"
 	break;
       case 21: /* "_REGEXP_" */
 #line 184 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1478 "grammar.c"
+#line 1484 "grammar.c"
 	break;
 
       default:
@@ -2082,25 +2088,33 @@ yyreduce:
   case 33:
 #line 478 "grammar.y"
     {
+        compiler->error_line = yyget_lineno(yyscanner);
+      }
+    break;
+
+  case 34:
+#line 482 "grammar.y"
+    {
         (yyval.string) = yr_parser_reduce_string_declaration(
-            yyscanner, (int32_t) (yyvsp[(4) - (4)].integer), (yyvsp[(1) - (4)].c_string), (yyvsp[(3) - (4)].sized_string));
+            yyscanner, (int32_t) (yyvsp[(5) - (5)].integer), (yyvsp[(1) - (5)].c_string), (yyvsp[(4) - (5)].sized_string));
 
-        yr_free((yyvsp[(1) - (4)].c_string));
-        yr_free((yyvsp[(3) - (4)].sized_string));
+        yr_free((yyvsp[(1) - (5)].c_string));
+        yr_free((yyvsp[(4) - (5)].sized_string));
 
         ERROR_IF((yyval.string) == NULL);
+        compiler->error_line = 0;
       }
     break;
 
-  case 34:
-#line 488 "grammar.y"
+  case 35:
+#line 493 "grammar.y"
     {
         compiler->error_line = yyget_lineno(yyscanner);
       }
     break;
 
-  case 35:
-#line 492 "grammar.y"
+  case 36:
+#line 497 "grammar.y"
     {
         (yyval.string) = yr_parser_reduce_string_declaration(
             yyscanner, (int32_t) (yyvsp[(5) - (5)].integer) | STRING_GFLAGS_REGEXP, (yyvsp[(1) - (5)].c_string), (yyvsp[(4) - (5)].sized_string));
@@ -2109,13 +2123,12 @@ yyreduce:
         yr_free((yyvsp[(4) - (5)].sized_string));
 
         ERROR_IF((yyval.string) == NULL);
-
         compiler->error_line = 0;
       }
     break;
 
-  case 36:
-#line 504 "grammar.y"
+  case 37:
+#line 508 "grammar.y"
     {
         (yyval.string) = yr_parser_reduce_string_declaration(
             yyscanner, STRING_GFLAGS_HEXADECIMAL, (yyvsp[(1) - (3)].c_string), (yyvsp[(3) - (3)].sized_string));
@@ -2124,41 +2137,42 @@ yyreduce:
         yr_free((yyvsp[(3) - (3)].sized_string));
 
         ERROR_IF((yyval.string) == NULL);
+        compiler->error_line = 0;
       }
     break;
 
-  case 37:
-#line 517 "grammar.y"
+  case 38:
+#line 522 "grammar.y"
     { (yyval.integer) = 0; }
     break;
 
-  case 38:
-#line 518 "grammar.y"
+  case 39:
+#line 523 "grammar.y"
     { (yyval.integer) = (yyvsp[(1) - (2)].integer) | (yyvsp[(2) - (2)].integer); }
     break;
 
-  case 39:
-#line 523 "grammar.y"
+  case 40:
+#line 528 "grammar.y"
     { (yyval.integer) = STRING_GFLAGS_WIDE; }
     break;
 
-  case 40:
-#line 524 "grammar.y"
+  case 41:
+#line 529 "grammar.y"
     { (yyval.integer) = STRING_GFLAGS_ASCII; }
     break;
 
-  case 41:
-#line 525 "grammar.y"
+  case 42:
+#line 530 "grammar.y"
     { (yyval.integer) = STRING_GFLAGS_NO_CASE; }
     break;
 
-  case 42:
-#line 526 "grammar.y"
+  case 43:
+#line 531 "grammar.y"
     { (yyval.integer) = STRING_GFLAGS_FULL_WORD; }
     break;
 
-  case 43:
-#line 532 "grammar.y"
+  case 44:
+#line 537 "grammar.y"
     {
         int var_index = yr_parser_lookup_loop_variable(yyscanner, (yyvsp[(1) - (1)].c_string));
 
@@ -2245,8 +2259,8 @@ yyreduce:
       }
     break;
 
-  case 44:
-#line 617 "grammar.y"
+  case 45:
+#line 622 "grammar.y"
     {
         YR_OBJECT* field = NULL;
 
@@ -2294,8 +2308,8 @@ yyreduce:
       }
     break;
 
-  case 45:
-#line 663 "grammar.y"
+  case 46:
+#line 668 "grammar.y"
     {
         YR_OBJECT_ARRAY* array;
         YR_OBJECT_DICTIONARY* dict;
@@ -2354,8 +2368,8 @@ yyreduce:
       }
     break;
 
-  case 46:
-#line 721 "grammar.y"
+  case 47:
+#line 726 "grammar.y"
     {
         YR_OBJECT_FUNCTION* function;
         char* args_fmt;
@@ -2398,18 +2412,18 @@ yyreduce:
       }
     break;
 
-  case 47:
-#line 765 "grammar.y"
+  case 48:
+#line 770 "grammar.y"
     { (yyval.c_string) = yr_strdup(""); }
     break;
 
-  case 48:
-#line 766 "grammar.y"
+  case 49:
+#line 771 "grammar.y"
     { (yyval.c_string) = (yyvsp[(1) - (1)].c_string); }
     break;
 
-  case 49:
-#line 771 "grammar.y"
+  case 50:
+#line 776 "grammar.y"
     {
         (yyval.c_string) = (char*) yr_malloc(MAX_FUNCTION_ARGS + 1);
 
@@ -2436,8 +2450,8 @@ yyreduce:
       }
     break;
 
-  case 50:
-#line 796 "grammar.y"
+  case 51:
+#line 801 "grammar.y"
     {
         if (strlen((yyvsp[(1) - (3)].c_string)) == MAX_FUNCTION_ARGS)
         {
@@ -2471,8 +2485,8 @@ yyreduce:
       }
     break;
 
-  case 51:
-#line 832 "grammar.y"
+  case 52:
+#line 837 "grammar.y"
     {
         SIZED_STRING* sized_string = (yyvsp[(1) - (1)].sized_string);
         RE* re;
@@ -2516,8 +2530,8 @@ yyreduce:
       }
     break;
 
-  case 52:
-#line 878 "grammar.y"
+  case 53:
+#line 883 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type == EXPRESSION_TYPE_STRING)
         {
@@ -2531,8 +2545,8 @@ yyreduce:
       }
     break;
 
-  case 53:
-#line 893 "grammar.y"
+  case 54:
+#line 898 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 1, NULL, NULL);
@@ -2543,8 +2557,8 @@ yyreduce:
       }
     break;
 
-  case 54:
-#line 902 "grammar.y"
+  case 55:
+#line 907 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 0, NULL, NULL);
@@ -2555,8 +2569,8 @@ yyreduce:
       }
     break;
 
-  case 55:
-#line 911 "grammar.y"
+  case 56:
+#line 916 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_STRING, "matches");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_REGEXP, "matches");
@@ -2573,8 +2587,8 @@ yyreduce:
       }
     break;
 
-  case 56:
-#line 926 "grammar.y"
+  case 57:
+#line 931 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_STRING, "contains");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_STRING, "contains");
@@ -2588,8 +2602,8 @@ yyreduce:
       }
     break;
 
-  case 57:
-#line 938 "grammar.y"
+  case 58:
+#line 943 "grammar.y"
     {
         int result = yr_parser_reduce_string_identifier(
             yyscanner,
@@ -2605,8 +2619,8 @@ yyreduce:
       }
     break;
 
-  case 58:
-#line 952 "grammar.y"
+  case 59:
+#line 957 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "at");
 
@@ -2621,8 +2635,8 @@ yyreduce:
       }
     break;
 
-  case 59:
-#line 965 "grammar.y"
+  case 60:
+#line 970 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner, (yyvsp[(1) - (3)].c_string), OP_FOUND_IN, UNDEFINED);
@@ -2635,8 +2649,8 @@ yyreduce:
       }
     break;
 
-  case 60:
-#line 976 "grammar.y"
+  case 61:
+#line 981 "grammar.y"
     {
         int var_index;
 
@@ -2668,8 +2682,8 @@ yyreduce:
       }
     break;
 
-  case 61:
-#line 1006 "grammar.y"
+  case 62:
+#line 1011 "grammar.y"
     {
         int mem_offset = LOOP_LOCAL_VARS * compiler->loop_depth;
         uint8_t* addr;
@@ -2706,8 +2720,8 @@ yyreduce:
       }
     break;
 
-  case 62:
-#line 1041 "grammar.y"
+  case 63:
+#line 1046 "grammar.y"
     {
         int mem_offset;
 
@@ -2790,8 +2804,8 @@ yyreduce:
       }
     break;
 
-  case 63:
-#line 1122 "grammar.y"
+  case 64:
+#line 1127 "grammar.y"
     {
         int mem_offset = LOOP_LOCAL_VARS * compiler->loop_depth;
         uint8_t* addr;
@@ -2823,8 +2837,8 @@ yyreduce:
       }
     break;
 
-  case 64:
-#line 1152 "grammar.y"
+  case 65:
+#line 1157 "grammar.y"
     {
         int mem_offset;
 
@@ -2876,8 +2890,8 @@ yyreduce:
       }
     break;
 
-  case 65:
-#line 1202 "grammar.y"
+  case 66:
+#line 1207 "grammar.y"
     {
         yr_parser_emit(yyscanner, OP_OF, NULL);
 
@@ -2885,8 +2899,8 @@ yyreduce:
       }
     break;
 
-  case 66:
-#line 1208 "grammar.y"
+  case 67:
+#line 1213 "grammar.y"
     {
         yr_parser_emit(yyscanner, OP_NOT, NULL);
 
@@ -2894,8 +2908,8 @@ yyreduce:
       }
     break;
 
-  case 67:
-#line 1214 "grammar.y"
+  case 68:
+#line 1219 "grammar.y"
     {
         YR_FIXUP* fixup;
         int64_t* jmp_destination_addr;
@@ -2923,8 +2937,8 @@ yyreduce:
       }
     break;
 
-  case 68:
-#line 1240 "grammar.y"
+  case 69:
+#line 1245 "grammar.y"
     {
         YR_FIXUP* fixup;
         uint8_t* and_addr;
@@ -2962,8 +2976,8 @@ yyreduce:
       }
     break;
 
-  case 69:
-#line 1276 "grammar.y"
+  case 70:
+#line 1281 "grammar.y"
     {
         YR_FIXUP* fixup;
         int64_t* jmp_destination_addr;
@@ -2990,8 +3004,8 @@ yyreduce:
       }
     break;
 
-  case 70:
-#line 1301 "grammar.y"
+  case 71:
+#line 1306 "grammar.y"
     {
         YR_FIXUP* fixup;
         uint8_t* or_addr;
@@ -3029,8 +3043,8 @@ yyreduce:
       }
     break;
 
-  case 71:
-#line 1337 "grammar.y"
+  case 72:
+#line 1342 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "<", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3041,8 +3055,8 @@ yyreduce:
       }
     break;
 
-  case 72:
-#line 1346 "grammar.y"
+  case 73:
+#line 1351 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, ">", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3053,8 +3067,8 @@ yyreduce:
       }
     break;
 
-  case 73:
-#line 1355 "grammar.y"
+  case 74:
+#line 1360 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "<=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3065,8 +3079,8 @@ yyreduce:
       }
     break;
 
-  case 74:
-#line 1364 "grammar.y"
+  case 75:
+#line 1369 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, ">=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3077,8 +3091,8 @@ yyreduce:
       }
     break;
 
-  case 75:
-#line 1373 "grammar.y"
+  case 76:
+#line 1378 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "==", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3089,8 +3103,8 @@ yyreduce:
       }
     break;
 
-  case 76:
-#line 1382 "grammar.y"
+  case 77:
+#line 1387 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "!=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3101,32 +3115,32 @@ yyreduce:
       }
     break;
 
-  case 77:
-#line 1391 "grammar.y"
+  case 78:
+#line 1396 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(1) - (1)].expression);
       }
     break;
 
-  case 78:
-#line 1395 "grammar.y"
+  case 79:
+#line 1400 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(2) - (3)].expression);
       }
     break;
 
-  case 79:
-#line 1402 "grammar.y"
+  case 80:
+#line 1407 "grammar.y"
     { (yyval.integer) = INTEGER_SET_ENUMERATION; }
     break;
 
-  case 80:
-#line 1403 "grammar.y"
+  case 81:
+#line 1408 "grammar.y"
     { (yyval.integer) = INTEGER_SET_RANGE; }
     break;
 
-  case 81:
-#line 1409 "grammar.y"
+  case 82:
+#line 1414 "grammar.y"
     {
         if ((yyvsp[(2) - (5)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3146,8 +3160,8 @@ yyreduce:
       }
     break;
 
-  case 82:
-#line 1431 "grammar.y"
+  case 83:
+#line 1436 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3161,8 +3175,8 @@ yyreduce:
       }
     break;
 
-  case 83:
-#line 1443 "grammar.y"
+  case 84:
+#line 1448 "grammar.y"
     {
         if ((yyvsp[(3) - (3)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3175,16 +3189,16 @@ yyreduce:
       }
     break;
 
-  case 84:
-#line 1458 "grammar.y"
+  case 85:
+#line 1463 "grammar.y"
     {
         // Push end-of-list marker
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
       }
     break;
 
-  case 86:
-#line 1464 "grammar.y"
+  case 87:
+#line 1469 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
         yr_parser_emit_pushes_for_strings(yyscanner, "$*");
@@ -3193,8 +3207,8 @@ yyreduce:
       }
     break;
 
-  case 89:
-#line 1481 "grammar.y"
+  case 90:
+#line 1486 "grammar.y"
     {
         yr_parser_emit_pushes_for_strings(yyscanner, (yyvsp[(1) - (1)].c_string));
         yr_free((yyvsp[(1) - (1)].c_string));
@@ -3203,8 +3217,8 @@ yyreduce:
       }
     break;
 
-  case 90:
-#line 1488 "grammar.y"
+  case 91:
+#line 1493 "grammar.y"
     {
         yr_parser_emit_pushes_for_strings(yyscanner, (yyvsp[(1) - (1)].c_string));
         yr_free((yyvsp[(1) - (1)].c_string));
@@ -3213,29 +3227,29 @@ yyreduce:
       }
     break;
 
-  case 92:
-#line 1500 "grammar.y"
+  case 93:
+#line 1505 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
       }
     break;
 
-  case 93:
-#line 1504 "grammar.y"
+  case 94:
+#line 1509 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, 1, NULL, NULL);
       }
     break;
 
-  case 94:
-#line 1512 "grammar.y"
+  case 95:
+#line 1517 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(2) - (3)].expression);
       }
     break;
 
-  case 95:
-#line 1516 "grammar.y"
+  case 96:
+#line 1521 "grammar.y"
     {
         compiler->last_result = yr_parser_emit(
             yyscanner, OP_FILESIZE, NULL);
@@ -3247,8 +3261,8 @@ yyreduce:
       }
     break;
 
-  case 96:
-#line 1526 "grammar.y"
+  case 97:
+#line 1531 "grammar.y"
     {
         yywarning(yyscanner,
             "Using deprecated \"entrypoint\" keyword. Use the \"entry_point\" "
@@ -3264,8 +3278,8 @@ yyreduce:
       }
     break;
 
-  case 97:
-#line 1540 "grammar.y"
+  case 98:
+#line 1545 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(3) - (4)].expression), EXPRESSION_TYPE_INTEGER, "intXXXX or uintXXXX");
 
@@ -3283,8 +3297,8 @@ yyreduce:
       }
     break;
 
-  case 98:
-#line 1556 "grammar.y"
+  case 99:
+#line 1561 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, (yyvsp[(1) - (1)].integer), NULL, NULL);
@@ -3296,8 +3310,8 @@ yyreduce:
       }
     break;
 
-  case 99:
-#line 1566 "grammar.y"
+  case 100:
+#line 1571 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg_double(
             yyscanner, OP_PUSH, (yyvsp[(1) - (1)].double_), NULL, NULL);
@@ -3308,8 +3322,8 @@ yyreduce:
       }
     break;
 
-  case 100:
-#line 1575 "grammar.y"
+  case 101:
+#line 1580 "grammar.y"
     {
         SIZED_STRING* sized_string;
 
@@ -3335,8 +3349,8 @@ yyreduce:
       }
     break;
 
-  case 101:
-#line 1599 "grammar.y"
+  case 102:
+#line 1604 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner, (yyvsp[(1) - (1)].c_string), OP_COUNT, UNDEFINED);
@@ -3350,8 +3364,8 @@ yyreduce:
       }
     break;
 
-  case 102:
-#line 1611 "grammar.y"
+  case 103:
+#line 1616 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner, (yyvsp[(1) - (4)].c_string), OP_OFFSET, UNDEFINED);
@@ -3365,8 +3379,8 @@ yyreduce:
       }
     break;
 
-  case 103:
-#line 1623 "grammar.y"
+  case 104:
+#line 1628 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 1, NULL, NULL);
@@ -3384,8 +3398,8 @@ yyreduce:
       }
     break;
 
-  case 104:
-#line 1639 "grammar.y"
+  case 105:
+#line 1644 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner, (yyvsp[(1) - (4)].c_string), OP_LENGTH, UNDEFINED);
@@ -3399,8 +3413,8 @@ yyreduce:
       }
     break;
 
-  case 105:
-#line 1651 "grammar.y"
+  case 106:
+#line 1656 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 1, NULL, NULL);
@@ -3418,8 +3432,8 @@ yyreduce:
       }
     break;
 
-  case 106:
-#line 1667 "grammar.y"
+  case 107:
+#line 1672 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type == EXPRESSION_TYPE_INTEGER)  // loop identifier
         {
@@ -3465,8 +3479,8 @@ yyreduce:
       }
     break;
 
-  case 107:
-#line 1711 "grammar.y"
+  case 108:
+#line 1716 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(2) - (2)].expression), EXPRESSION_TYPE_INTEGER | EXPRESSION_TYPE_FLOAT, "-");
 
@@ -3487,8 +3501,8 @@ yyreduce:
       }
     break;
 
-  case 108:
-#line 1730 "grammar.y"
+  case 109:
+#line 1735 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "+", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3508,8 +3522,8 @@ yyreduce:
       }
     break;
 
-  case 109:
-#line 1748 "grammar.y"
+  case 110:
+#line 1753 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "-", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3529,8 +3543,8 @@ yyreduce:
       }
     break;
 
-  case 110:
-#line 1766 "grammar.y"
+  case 111:
+#line 1771 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "*", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3550,8 +3564,8 @@ yyreduce:
       }
     break;
 
-  case 111:
-#line 1784 "grammar.y"
+  case 112:
+#line 1789 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "\\", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3579,8 +3593,8 @@ yyreduce:
       }
     break;
 
-  case 112:
-#line 1810 "grammar.y"
+  case 113:
+#line 1815 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "%");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "%");
@@ -3600,8 +3614,8 @@ yyreduce:
       }
     break;
 
-  case 113:
-#line 1828 "grammar.y"
+  case 114:
+#line 1833 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
@@ -3613,8 +3627,8 @@ yyreduce:
       }
     break;
 
-  case 114:
-#line 1838 "grammar.y"
+  case 115:
+#line 1843 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
@@ -3626,8 +3640,8 @@ yyreduce:
       }
     break;
 
-  case 115:
-#line 1848 "grammar.y"
+  case 116:
+#line 1853 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "|");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "|");
@@ -3639,8 +3653,8 @@ yyreduce:
       }
     break;
 
-  case 116:
-#line 1858 "grammar.y"
+  case 117:
+#line 1863 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(2) - (2)].expression), EXPRESSION_TYPE_INTEGER, "~");
 
@@ -3652,8 +3666,8 @@ yyreduce:
       }
     break;
 
-  case 117:
-#line 1868 "grammar.y"
+  case 118:
+#line 1873 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "<<");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "<<");
@@ -3665,8 +3679,8 @@ yyreduce:
       }
     break;
 
-  case 118:
-#line 1878 "grammar.y"
+  case 119:
+#line 1883 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, ">>");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, ">>");
@@ -3678,8 +3692,8 @@ yyreduce:
       }
     break;
 
-  case 119:
-#line 1888 "grammar.y"
+  case 120:
+#line 1893 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(1) - (1)].expression);
       }
@@ -3687,7 +3701,7 @@ yyreduce:
 
 
 /* Line 1267 of yacc.c.  */
-#line 3691 "grammar.c"
+#line 3705 "grammar.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -3901,6 +3915,6 @@ yyreturn:
 }
 
 
-#line 1893 "grammar.y"
+#line 1898 "grammar.y"
 
 
diff --git a/libyara/grammar.y b/libyara/grammar.y
index 22fa7f5..7716110 100644
--- a/libyara/grammar.y
+++ b/libyara/grammar.y
@@ -474,15 +474,20 @@ string_declarations
 
 
 string_declaration
-    : _STRING_IDENTIFIER_ '=' _TEXT_STRING_ string_modifiers
+    : _STRING_IDENTIFIER_ '='
+      {
+        compiler->error_line = yyget_lineno(yyscanner);
+      }
+      _TEXT_STRING_ string_modifiers
       {
         $$ = yr_parser_reduce_string_declaration(
-            yyscanner, (int32_t) $4, $1, $3);
+            yyscanner, (int32_t) $5, $1, $4);
 
         yr_free($1);
-        yr_free($3);
+        yr_free($4);
 
         ERROR_IF($$ == NULL);
+        compiler->error_line = 0;
       }
     | _STRING_IDENTIFIER_ '='
       {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list