* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
debug.c, debug.h: merge half-baked-1.9 changes. The biggest change
is to change node structure around NODE_SCOPE, NODE_ARGS. Every
scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
represents more details of arguments information. I'll write a
document about detail of node structure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21 07:15:15 -04:00
|
|
|
/* C code produced by gperf version 3.0.2 */
|
2007-06-15 07:50:45 -04:00
|
|
|
/* Command-line: gperf --output-file=lex.c.tmp -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' keywords */
|
2006-06-26 10:15:49 -04:00
|
|
|
|
|
|
|
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
|
|
|
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
|
|
|
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
|
|
|
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
|
|
|
|
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
|
|
|
|
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
|
|
|
|
&& ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
|
|
|
|
&& ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
|
|
|
|
&& ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
|
|
|
|
&& ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
|
|
|
|
&& ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
|
|
|
|
&& ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
|
|
|
|
&& ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
|
|
|
|
&& ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
|
|
|
|
&& ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
|
|
|
|
&& ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
|
|
|
|
&& ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
|
|
|
|
&& ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
|
|
|
|
&& ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
|
|
|
|
&& ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
|
|
|
|
&& ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
|
|
|
|
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
|
|
|
|
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
|
|
|
|
/* The character set is not based on ISO-646. */
|
|
|
|
error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#line 1 "keywords"
|
2007-06-15 07:50:45 -04:00
|
|
|
|
2008-05-31 05:28:20 -04:00
|
|
|
struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
|
2007-12-24 23:17:06 -05:00
|
|
|
const struct kwtable *rb_reserved_word(const char *, unsigned int);
|
2004-09-19 14:48:29 -04:00
|
|
|
#ifndef RIPPER
|
2007-06-15 07:50:45 -04:00
|
|
|
#line 7 "keywords"
|
|
|
|
struct kwtable;
|
1998-01-16 07:19:09 -05:00
|
|
|
|
2007-12-20 22:22:22 -05:00
|
|
|
#define TOTAL_KEYWORDS 41
|
1998-01-16 07:19:09 -05:00
|
|
|
#define MIN_WORD_LENGTH 2
|
2007-12-20 22:22:22 -05:00
|
|
|
#define MAX_WORD_LENGTH 12
|
|
|
|
#define MIN_HASH_VALUE 8
|
2006-06-26 10:15:49 -04:00
|
|
|
#define MAX_HASH_VALUE 50
|
2007-12-20 22:22:22 -05:00
|
|
|
/* maximum key range = 43, duplicates = 0 */
|
1998-01-16 07:19:09 -05:00
|
|
|
|
|
|
|
#ifdef __GNUC__
|
1999-08-13 01:45:20 -04:00
|
|
|
__inline
|
2001-07-02 04:46:28 -04:00
|
|
|
#else
|
|
|
|
#ifdef __cplusplus
|
|
|
|
inline
|
|
|
|
#endif
|
1998-01-16 07:19:09 -05:00
|
|
|
#endif
|
|
|
|
static unsigned int
|
|
|
|
hash (str, len)
|
1999-08-13 01:45:20 -04:00
|
|
|
register const char *str;
|
|
|
|
register unsigned int len;
|
1998-01-16 07:19:09 -05:00
|
|
|
{
|
2005-07-13 09:44:21 -04:00
|
|
|
static const unsigned char asso_values[] =
|
1998-01-16 07:19:09 -05:00
|
|
|
{
|
2006-06-26 10:15:49 -04:00
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
2007-12-20 22:22:22 -05:00
|
|
|
51, 51, 51, 26, 51, 51, 14, 51, 16, 8,
|
|
|
|
11, 13, 51, 51, 51, 51, 10, 51, 13, 51,
|
2006-06-26 10:15:49 -04:00
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 11, 51, 13, 1, 26,
|
|
|
|
4, 1, 8, 28, 51, 23, 51, 1, 1, 27,
|
|
|
|
5, 19, 21, 51, 8, 3, 3, 11, 51, 21,
|
|
|
|
24, 16, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
|
|
|
|
51, 51, 51, 51, 51, 51
|
1998-01-16 07:19:09 -05:00
|
|
|
};
|
|
|
|
register int hval = len;
|
|
|
|
|
|
|
|
switch (hval)
|
|
|
|
{
|
|
|
|
default:
|
1999-08-13 01:45:20 -04:00
|
|
|
hval += asso_values[(unsigned char)str[2]];
|
2006-06-26 10:15:49 -04:00
|
|
|
/*FALLTHROUGH*/
|
1998-01-16 07:19:09 -05:00
|
|
|
case 2:
|
|
|
|
case 1:
|
1999-08-13 01:45:20 -04:00
|
|
|
hval += asso_values[(unsigned char)str[0]];
|
1998-01-16 07:19:09 -05:00
|
|
|
break;
|
|
|
|
}
|
1999-08-13 01:45:20 -04:00
|
|
|
return hval + asso_values[(unsigned char)str[len - 1]];
|
1998-01-16 07:19:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
1999-08-13 01:45:20 -04:00
|
|
|
__inline
|
1998-01-16 07:19:09 -05:00
|
|
|
#endif
|
2005-07-13 09:44:21 -04:00
|
|
|
const struct kwtable *
|
1998-01-16 07:19:09 -05:00
|
|
|
rb_reserved_word (str, len)
|
1999-08-13 01:45:20 -04:00
|
|
|
register const char *str;
|
1998-01-16 07:19:09 -05:00
|
|
|
register unsigned int len;
|
|
|
|
{
|
2005-07-13 09:44:21 -04:00
|
|
|
static const struct kwtable wordlist[] =
|
1998-01-16 07:19:09 -05:00
|
|
|
{
|
2007-12-20 22:22:22 -05:00
|
|
|
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
|
|
|
|
#line 17 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"break", {keyword_break, keyword_break}, EXPR_MID},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 23 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"else", {keyword_else, keyword_else}, EXPR_BEG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 33 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"nil", {keyword_nil, keyword_nil}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 26 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 25 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"end", {keyword_end, keyword_end}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 42 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"then", {keyword_then, keyword_then}, EXPR_BEG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 34 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"not", {keyword_not, keyword_not}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 27 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"false", {keyword_false, keyword_false}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 40 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"self", {keyword_self, keyword_self}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 24 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 37 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 43 "keywords"
|
2007-06-15 07:50:45 -04:00
|
|
|
{"true", {keyword_true, keyword_true}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 46 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"until", {keyword_until, modifier_until}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 45 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 39 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"return", {keyword_return, keyword_return}, EXPR_MID},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 20 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"def", {keyword_def, keyword_def}, EXPR_FNAME},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 15 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"and", {keyword_and, keyword_and}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 22 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"do", {keyword_do, keyword_do}, EXPR_BEG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 49 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 28 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"for", {keyword_for, keyword_for}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 44 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 35 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"or", {keyword_or, keyword_or}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 30 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"in", {keyword_in, keyword_in}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 47 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"when", {keyword_when, keyword_when}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 38 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"retry", {keyword_retry, keyword_retry}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 29 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"if", {keyword_if, modifier_if}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 18 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"case", {keyword_case, keyword_case}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 36 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"redo", {keyword_redo, keyword_redo}, EXPR_END},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 32 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"next", {keyword_next, keyword_next}, EXPR_MID},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 41 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"super", {keyword_super, keyword_super}, EXPR_ARG},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 31 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"module", {keyword_module, keyword_module}, EXPR_VALUE},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 16 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
|
2007-06-15 07:50:45 -04:00
|
|
|
#line 10 "keywords"
|
2007-12-20 22:22:22 -05:00
|
|
|
{"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
|
2007-06-15 07:50:45 -04:00
|
|
|
#line 11 "keywords"
|
2007-12-20 22:22:22 -05:00
|
|
|
{"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
|
|
|
|
#line 9 "keywords"
|
|
|
|
{"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
|
2007-06-15 07:50:45 -04:00
|
|
|
#line 13 "keywords"
|
2007-12-20 22:22:22 -05:00
|
|
|
{"END", {keyword_END, keyword_END}, EXPR_END},
|
|
|
|
#line 14 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 12 "keywords"
|
|
|
|
{"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
|
|
|
|
#line 21 "keywords"
|
|
|
|
{"defined?", {keyword_defined, keyword_defined}, EXPR_ARG},
|
|
|
|
#line 19 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"class", {keyword_class, keyword_class}, EXPR_CLASS},
|
|
|
|
{""}, {""},
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 48 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
{"while", {keyword_while, modifier_while}, EXPR_VALUE}
|
1998-01-16 07:19:09 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
|
|
|
{
|
|
|
|
register int key = hash (str, len);
|
|
|
|
|
|
|
|
if (key <= MAX_HASH_VALUE && key >= 0)
|
|
|
|
{
|
1999-08-13 01:45:20 -04:00
|
|
|
register const char *s = wordlist[key].name;
|
1998-01-16 07:19:09 -05:00
|
|
|
|
1999-08-13 01:45:20 -04:00
|
|
|
if (*str == *s && !strcmp (str + 1, s + 1))
|
1998-01-16 07:19:09 -05:00
|
|
|
return &wordlist[key];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2007-12-20 22:22:22 -05:00
|
|
|
#line 50 "keywords"
|
2006-06-26 10:15:49 -04:00
|
|
|
|
2004-09-19 14:48:29 -04:00
|
|
|
#endif
|