From 4394083138744a47fd8f2a14c46e1fd008b38772 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Sun, 1 Nov 2015 15:57:20 -0800 Subject: [PATCH] Added comma token --- libraries/animation/src/AnimExpression.cpp | 79 +--------------------- libraries/animation/src/AnimExpression.h | 4 +- 2 files changed, 2 insertions(+), 81 deletions(-) diff --git a/libraries/animation/src/AnimExpression.cpp b/libraries/animation/src/AnimExpression.cpp index 14b3e9da87..fe056be81d 100644 --- a/libraries/animation/src/AnimExpression.cpp +++ b/libraries/animation/src/AnimExpression.cpp @@ -14,83 +14,6 @@ #include "AnimExpression.h" #include "AnimationLogging.h" - -#ifndef NDEBUG -void AnimExpression::Token::dump() { - switch (type) { - case End: - qCDebug(animation) << " End"; - break; - case Identifier: - qCDebug(animation) << " Identifer =" << strVal; - break; - case LiteralInt: - qCDebug(animation) << " LiteralInt =" << intVal; - break; - case LiteralFloat: - qCDebug(animation) << " LiteralFloat" << floatVal; - break; - case LiteralVec3: - qCDebug(animation) << " LiteralVec3" << vec3Val; - break; - case LiteralVec4: - qCDebug(animation) << " LiteralVec4" << vec4Val; - break; - case LiteralQuat: - qCDebug(animation) << " LiteralQuat" << quatVal; - break; - case And: - qCDebug(animation) << " And"; - break; - case Or: - qCDebug(animation) << " Or"; - break; - case GreaterThan: - qCDebug(animation) << " GreaterThan"; - break; - case GreaterThanEqual: - qCDebug(animation) << " GreaterThanEqual"; - break; - case LessThan: - qCDebug(animation) << " LessThan"; - break; - case LessThanEqual: - qCDebug(animation) << " LessThanEqual"; - break; - case Equal: - qCDebug(animation) << " Equal"; - break; - case NotEqual: - qCDebug(animation) << " NotEqual"; - break; - case LeftParen: - qCDebug(animation) << " LeftParen"; - break; - case RightParen: - qCDebug(animation) << " RightParen"; - break; - case Not: - qCDebug(animation) << " Not"; - break; - case Minus: - qCDebug(animation) << " Minus"; - break; - case Plus: - qCDebug(animation) << " Plus"; - break; - case Multiply: - qCDebug(animation) << " Multiply"; - break; - case Modulus: - qCDebug(animation) << " Modulus"; - break; - case Error: - qCDebug(animation) << " Error"; - break; - } -} -#endif - AnimExpression::AnimExpression(const QString& str) : _expression(str) { parseExpression(_expression); @@ -130,6 +53,7 @@ AnimExpression::Token AnimExpression::consumeToken(const QString& str, QString:: case '+': ++iter; return Token(Token::Plus); case '*': ++iter; return Token(Token::Multiply); case '%': ++iter; return Token(Token::Modulus); + case ',': ++iter; return Token(Token::Comma); default: qCCritical(animation) << "AnimExpression: unexpected char" << *iter << "at index " << (int)(iter - str.begin()); return Token(Token::Error); @@ -261,4 +185,3 @@ AnimExpression::Token AnimExpression::consumeNot(const QString& str, QString::co return Token(Token::Not); } } - diff --git a/libraries/animation/src/AnimExpression.h b/libraries/animation/src/AnimExpression.h index 25e1803721..7e6c42f08a 100644 --- a/libraries/animation/src/AnimExpression.h +++ b/libraries/animation/src/AnimExpression.h @@ -45,6 +45,7 @@ protected: Plus, Multiply, Modulus, + Comma, Error }; Token(Type type) : type(type) {} @@ -58,9 +59,6 @@ protected: glm::vec3 vec3Val; glm::vec4 vec4Val; glm::quat quatVal; -#ifndef NDEBUG - void dump(); -#endif }; bool parseExpression(const QString& str); Token consumeToken(const QString& str, QString::const_iterator& iter) const;