src/compiler/Symbols.h
changeset 256 3c184218462d
parent 233 bbb498ccb4ac
child 258 241d082d6d89
     1.1 --- a/src/compiler/Symbols.h	Tue Jan 01 20:08:34 2013 -0800
     1.2 +++ b/src/compiler/Symbols.h	Sun Jan 06 13:52:21 2013 -0800
     1.3 @@ -38,8 +38,8 @@
     1.4      _(Constant)         \
     1.5      /* A named type (class struct, typedef, etc) produces a TypeSymbol. */ \
     1.6      _(Type)             \
     1.7 -    /* // A module import produces a ModuleSymbol. */   \
     1.8 -    _(Module)
     1.9 +    /* An import name. */ \
    1.10 +    _(Import)
    1.11  
    1.12  #define _(name)     class name##Symbol;
    1.13  SYMBOL_KINDS(_)
    1.14 @@ -208,6 +208,28 @@
    1.15      BoxedPrimitive value_;
    1.16  };
    1.17  
    1.18 +class ImportSymbol : public Symbol
    1.19 +{
    1.20 +  public:
    1.21 +    ImportSymbol(Scope *scope, Handle<String> name, const SourcePosition &pos, Handle<Type> type,
    1.22 +                 unsigned index)
    1.23 +      : Symbol(scope, name, pos),
    1.24 +        index_(index)
    1.25 +    {
    1.26 +        type_ = type;
    1.27 +    }
    1.28 +
    1.29 +    Kind kind() const {
    1.30 +        return kImport;
    1.31 +    }
    1.32 +    unsigned index() const {
    1.33 +        return index_;
    1.34 +    }
    1.35 +
    1.36 +  private:
    1.37 +      unsigned index_;
    1.38 +};
    1.39 +
    1.40  }
    1.41  
    1.42  #endif // _include_sp2_symbol_h_