LCOV - code coverage report
Current view: top level - src/pl/plpgsql/src - pl_reserved_kwlist_d.h (source / functions) Hit Total Coverage
Test: PostgreSQL 17devel Lines: 9 9 100.0 %
Date: 2024-04-19 13:11:37 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-2024, 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      174176 : ReservedPLKeywords_hash_func(const void *key, size_t keylen)
      81             : {
      82             :     static const int8 h[49] = {
      83             :         127,   7,     127,   127,   -2,    127,   13,    127,
      84             :         127,   5,     0,     23,    0,     2,     127,   0,
      85             :         17,    0,     127,   19,    5,     127,   6,     2,
      86             :         -3,    17,    0,     6,     127,   8,     18,    127,
      87             :         -6,    3,     -5,    0,     127,   0,     0,     11,
      88             :         15,    127,   127,   127,   13,    127,   0,     17,
      89             :         127
      90             :     };
      91             : 
      92      174176 :     const unsigned char *k = (const unsigned char *) key;
      93      174176 :     uint32      a = 0;
      94      174176 :     uint32      b = 1;
      95             : 
      96      881374 :     while (keylen--)
      97             :     {
      98      707198 :         unsigned char c = *k++ | 0x20;
      99             : 
     100      707198 :         a = a * 257 + c;
     101      707198 :         b = b * 8191 + c;
     102             :     }
     103      174176 :     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.14