Branch: Tag:

1999-03-29

1999-03-29 20:17:21 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added implicit range start and end to opt_int_range.

Rev: src/language.yacc:1.115

181:   /* This is the grammar definition of Pike. */      #include "global.h" - RCSID("$Id: language.yacc,v 1.114 1999/03/11 13:44:30 hubbe Exp $"); + RCSID("$Id: language.yacc,v 1.115 1999/03/29 20:17:21 grubba Exp $");   #ifdef HAVE_MEMORY_H   #include <memory.h>   #endif
298:   %type <number> modifier   %type <number> modifier_list   %type <number> modifiers + %type <number> number_or_maxint + %type <number> number_or_minint   %type <number> optional_dot_dot_dot   %type <number> optional_stars   
839:    | F_FUNCTION_ID opt_function_type { push_type(T_FUNCTION); }    ;    - opt_int_range: { push_type_int(MAX_INT32); push_type_int(MIN_INT32); } -  | '(' F_NUMBER F_DOT_DOT F_NUMBER ')' + number_or_maxint: /* Empty */    { -  +  $$ = MAX_INT32; +  } +  | F_NUMBER +  ; +  + number_or_minint: /* Empty */ +  { +  $$ = MIN_INT32; +  } +  | F_NUMBER +  ; +  + opt_int_range: /* Empty */ +  { +  push_type_int(MAX_INT32); +  push_type_int(MIN_INT32); +  } +  | '(' number_or_minint F_DOT_DOT number_or_maxint ')' +  { +  /* FIXME: Check that $4 is >= $2. */    push_type_int($4);    push_type_int($2);    }