src/compiler/Symbols.h
changeset 233 bbb498ccb4ac
parent 220 5df4a112967d
child 256 3c184218462d
     1.1 --- a/src/compiler/Symbols.h	Sat Dec 22 19:48:43 2012 -0800
     1.2 +++ b/src/compiler/Symbols.h	Sat Dec 22 23:18:57 2012 -0800
     1.3 @@ -186,6 +186,28 @@
     1.4      }
     1.5  };
     1.6  
     1.7 +class ConstantSymbol : public Symbol
     1.8 +{
     1.9 +  public:
    1.10 +    ConstantSymbol(Scope *scope, Handle<String> name, const SourcePosition &pos, Handle<Type> type,
    1.11 +                   const BoxedPrimitive &prim)
    1.12 +      : Symbol(scope, name, pos),
    1.13 +        value_(prim)
    1.14 +    {
    1.15 +        type_ = type;
    1.16 +    }
    1.17 +
    1.18 +    Kind kind() const {
    1.19 +        return kConstant;
    1.20 +    }
    1.21 +    const BoxedPrimitive &value() const {
    1.22 +        return value_;
    1.23 +    }
    1.24 +
    1.25 +  private:
    1.26 +    BoxedPrimitive value_;
    1.27 +};
    1.28 +
    1.29  }
    1.30  
    1.31  #endif // _include_sp2_symbol_h_