Branch: Tag:

2016-01-04

2016-01-04 14:57:57 by Per Hedbor <ph@opera.com>

Allow typeof(X) to be used as a type.

Use this feature to allow bool to be int(1..1)|int(0..0), that is,
bypass the optimization that removes int(0..0) from it.

1731:    "describe_error",    "get_backtrace",    "normalize_path", -  "bool", +     "true",    "false",    "getenv",
1782:    else    error("Function %O is missing from master.pike.\n", e);    +  + // This gives the type int(1..1)|zero, which is more close to reality + // than the enum type (aka int(1..1)) + // + // doing the add_constant on the typeof directly gives int(1..1) + // instead, since the same "optimization" of the type is done in that + // case. +  typeof(0)|typeof(1) _bool_type; +  add_constant("bool",typeof(_bool_type)); +     add_constant("__dirnode", dirnode);    add_constant("__joinnode", joinnode);   
1837:    add_module_path(__embedded_resource_directory + "/" + replace(uname()->machine, " ", "_") + "/modules");      #endif -  +     system_module_path=pike_module_path;   }