src/Parser.cpp
changeset 167 cf82769eb136
parent 165 b67697fba413
child 170 5e4570966ece
     1.1 --- a/src/Parser.cpp	Sun Aug 05 14:19:19 2012 -0700
     1.2 +++ b/src/Parser.cpp	Sun Aug 05 15:38:52 2012 -0700
     1.3 @@ -1226,16 +1226,21 @@
     1.4  }
     1.5  
     1.6  static inline bool
     1.7 -DeclareIntrinsicType(Zone *zone, Scope *scope, const char *name, PrimitiveType type)
     1.8 +DeclareIntrinsicType(Zone *zone, Scope *scope, const char *name, Handle<Type> type)
     1.9  {
    1.10      Local<String> tag(zone, zone->makeSymbol(name));
    1.11      if (!tag)
    1.12          return false;
    1.13  
    1.14 +    return !!scope->declareType(tag, type);
    1.15 +}
    1.16 +
    1.17 +static inline bool
    1.18 +DeclareIntrinsicType(Zone *zone, Scope *scope, const char *name, PrimitiveType type)
    1.19 +{
    1.20      Local<Type> primitive(zone, zone->types()->getPrimitive(type));
    1.21      assert(primitive);
    1.22 -
    1.23 -    return !!scope->declareType(tag, primitive);
    1.24 +    return DeclareIntrinsicType(zone, scope, name, primitive);
    1.25  }
    1.26  
    1.27  bool
    1.28 @@ -1249,6 +1254,11 @@
    1.29          return false;
    1.30      if (!DeclareIntrinsicType(zone_, scope_, "String", PrimitiveType_Char))
    1.31          return false;
    1.32 +
    1.33 +    Local<Type> unchecked(zone_, zone_->types()->getUnchecked());
    1.34 +    if (!DeclareIntrinsicType(zone_, scope_, "unchecked", unchecked))
    1.35 +        return false;
    1.36 +
    1.37      return true;
    1.38  }
    1.39