diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2016-08-31 20:05:10 +0000 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2016-08-31 20:05:10 +0000 |
| commit | c4cae690deddcb8a7fc6a537816e832525ca0e86 (patch) | |
| tree | 42a78dedb03d776e3945c1729a2e4b1d264ef2ed /value.cpp | |
| parent | 1ba5c17a68f13633d6a20785c722b22032ba45c4 (diff) | |
Develop runtime
Diffstat (limited to 'value.cpp')
| -rw-r--r-- | value.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,14 +1,13 @@ #include "value.h" #include <string> -Value::Value(std::string& lexeme) { - if (lexeme.find_first_not_of("0123456789")) { +Value::Value(Token& token) { + if (!token.isString()) m_type = Value::Type::Integer; - m_intData = std::stoi(lexeme, nullptr, 10); - } - else { + m_intData = std::stoi(token.getLexeme(), nullptr, 10); + } else { m_type = Value::Type::String; - m_strData = lexeme; + m_strData = token.getLexeme(); } } |
