Branch: Tag:

2014-12-04

2014-12-04 19:25:19 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Added syntax for declaring type types.

The program type can now be used to declare type types:

program(int(8bit)) == type(int(8bit))

This avoids the need to go via typedefs, typeof() or _typeof().

930:    PT_COPY_BOTH);    break;    +  case T_PROGRAM: +  if ((*Pike_compiler->type_stackp)->type != T_OBJECT) { +  /* Not a program type, convert it to a type type. */ +  type = T_TYPE; +  } +  /* FALL_THROUGH */    case T_ARRAY:    case T_MULTISET:    case T_NOT:    case T_TYPE: -  case T_PROGRAM: +     case T_STRING:    /* Make a new type of the top type, and put it in car. */    *Pike_compiler->type_stackp = mk_type(type,