LCOV - code coverage report
Current view: top level - src/pl/plpgsql/src - pl_reserved_kwlist_d.h (source / functions) Hit Total Coverage
Test: PostgreSQL 13devel Lines: 9 9 100.0 %
Date: 2019-09-22 08:06:49 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*-------------------------------------------------------------------------
       2             :  *
       3             :  * pl_reserved_kwlist_d.h
       4             :  *    List of keywords represented as a ScanKeywordList.
       5             :  *
       6             :  * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
       7             :  * Portions Copyright (c) 1994, Regents of the University of California
       8             :  *
       9             :  * NOTES
      10             :  *  ******************************
      11             :  *  *** DO NOT EDIT THIS FILE! ***
      12             :  *  ******************************
      13             :  *
      14             :  *  It has been GENERATED by src/tools/gen_keywordlist.pl
      15             :  *
      16             :  *-------------------------------------------------------------------------
      17             :  */
      18             : 
      19             : #ifndef PL_RESERVED_KWLIST_D_H
      20             : #define PL_RESERVED_KWLIST_D_H
      21             : 
      22             : #include "common/kwlookup.h"
      23             : 
      24             : static const char ReservedPLKeywords_kw_string[] =
      25             :     "all\0"
      26             :     "begin\0"
      27             :     "by\0"
      28             :     "case\0"
      29             :     "declare\0"
      30             :     "else\0"
      31             :     "end\0"
      32             :     "execute\0"
      33             :     "for\0"
      34             :     "foreach\0"
      35             :     "from\0"
      36             :     "if\0"
      37             :     "in\0"
      38             :     "into\0"
      39             :     "loop\0"
      40             :     "not\0"
      41             :     "null\0"
      42             :     "or\0"
      43             :     "strict\0"
      44             :     "then\0"
      45             :     "to\0"
      46             :     "using\0"
      47             :     "when\0"
      48             :     "while";
      49             : 
      50             : static const uint16 ReservedPLKeywords_kw_offsets[] = {
      51             :     0,
      52             :     4,
      53             :     10,
      54             :     13,
      55             :     18,
      56             :     26,
      57             :     31,
      58             :     35,
      59             :     43,
      60             :     47,
      61             :     55,
      62             :     60,
      63             :     63,
      64             :     66,
      65             :     71,
      66             :     76,
      67             :     80,
      68             :     85,
      69             :     88,
      70             :     95,
      71             :     100,
      72             :     103,
      73             :     109,
      74             :     114,
      75             : };
      76             : 
      77             : #define RESERVEDPLKEYWORDS_NUM_KEYWORDS 24
      78             : 
      79             : static int
      80       76318 : ReservedPLKeywords_hash_func(const void *key, size_t keylen)
      81             : {
      82             :     static const int8 h[49] = {
      83             :             -2,    127,      7,    127,      0,    127,    127,    127,
      84             :             18,      5,    127,     27,    127,      0,    127,    127,
      85             :              0,     39,     32,     22,     10,    127,     19,    -26,
      86             :            127,    -11,      0,     12,    127,    127,     -1,     28,
      87             :             20,      0,     23,    127,      0,     14,     -8,    127,
      88             :            127,    127,     13,      5,    127,    -23,      1,      0,
      89             :            127,
      90             :     };
      91             : 
      92       76318 :     const unsigned char *k = (const unsigned char *) key;
      93       76318 :     uint32      a = 0;
      94       76318 :     uint32      b = 1;
      95             : 
      96      457816 :     while (keylen--)
      97             :     {
      98      305180 :         unsigned char c = *k++ | 0x20;
      99             : 
     100      305180 :         a = a * 31 + c;
     101      305180 :         b = b * 127 + c;
     102             :     }
     103       76318 :     return h[a % 49] + h[b % 49];
     104             : }
     105             : 
     106             : static const ScanKeywordList ReservedPLKeywords = {
     107             :     ReservedPLKeywords_kw_string,
     108             :     ReservedPLKeywords_kw_offsets,
     109             :     ReservedPLKeywords_hash_func,
     110             :     RESERVEDPLKEYWORDS_NUM_KEYWORDS,
     111             :     7
     112             : };
     113             : 
     114             : #endif                          /* PL_RESERVED_KWLIST_D_H */

Generated by: LCOV version 1.13