From 7b918a7bc7a3c619682266b1c2566dacb9dcc765 Mon Sep 17 00:00:00 2001 From: RJ Catalano Date: Mon, 8 Feb 2016 15:43:22 -0600 Subject: changes to redefine the token list, the scanner, and the parser and how they pass around variable types of different sizes not ready for change to FixedPoint just yet made this more const correct and added a switch statement for easier reading --- libsolidity/ast/AST.h | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'libsolidity/ast/AST.h') diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index e1063467..d32d76a4 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -756,18 +756,17 @@ public: class ElementaryTypeName: public TypeName { public: - ElementaryTypeName(SourceLocation const& _location, Token::Value _type): - TypeName(_location), m_type(_type) - { - solAssert(Token::isElementaryTypeName(_type), ""); - } + ElementaryTypeName(SourceLocation const& _location, ElementaryTypeNameToken const& _elem): + TypeName(_location), m_type(_elem) + {} + virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; - Token::Value typeName() const { return m_type; } + ElementaryTypeNameToken const& typeName() const { return m_type; } private: - Token::Value m_type; + ElementaryTypeNameToken m_type; }; /** @@ -1408,18 +1407,16 @@ private: class ElementaryTypeNameExpression: public PrimaryExpression { public: - ElementaryTypeNameExpression(SourceLocation const& _location, Token::Value _typeToken): - PrimaryExpression(_location), m_typeToken(_typeToken) - { - solAssert(Token::isElementaryTypeName(_typeToken), ""); - } + ElementaryTypeNameExpression(SourceLocation const& _location, ElementaryTypeNameToken const& _type): + PrimaryExpression(_location), m_typeToken(_type) + {} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; - Token::Value typeToken() const { return m_typeToken; } + ElementaryTypeNameToken const& typeName() const { return m_typeToken; } private: - Token::Value m_typeToken; + ElementaryTypeNameToken m_typeToken; }; /** -- cgit