863 comm->origin = m_lexer->describeCurrentPosition(); |
863 comm->origin = m_lexer->describeCurrentPosition(); |
864 |
864 |
865 // Return value |
865 // Return value |
866 m_lexer->mustGetAnyOf ({Token::Int,Token::Void,Token::Bool,Token::Str}); |
866 m_lexer->mustGetAnyOf ({Token::Int,Token::Void,Token::Bool,Token::Str}); |
867 comm->returnvalue = getTypeByName (m_lexer->token()->text); // TODO |
867 comm->returnvalue = getTypeByName (m_lexer->token()->text); // TODO |
868 ASSERT_NE (comm->returnvalue, -1); |
868 ASSERT_NE (comm->returnvalue, TYPE_Unknown); |
869 |
869 |
870 // Number |
870 // Number |
871 m_lexer->mustGetNext (Token::Number); |
871 m_lexer->mustGetNext (Token::Number); |
872 comm->number = m_lexer->token()->text.toLong(); |
872 comm->number = m_lexer->token()->text.toLong(); |
873 m_lexer->mustGetNext (Token::Colon); |
873 m_lexer->mustGetNext (Token::Colon); |
886 m_lexer->mustGetNext (Token::Comma); |
886 m_lexer->mustGetNext (Token::Comma); |
887 |
887 |
888 CommandArgument arg; |
888 CommandArgument arg; |
889 m_lexer->mustGetAnyOf ({Token::Int,Token::Bool,Token::Str}); |
889 m_lexer->mustGetAnyOf ({Token::Int,Token::Bool,Token::Str}); |
890 DataType type = getTypeByName (m_lexer->token()->text); // TODO |
890 DataType type = getTypeByName (m_lexer->token()->text); // TODO |
891 ASSERT_NE (type, -1) |
891 ASSERT_NE (type, TYPE_Unknown) |
892 ASSERT_NE (type, TYPE_Void) |
892 ASSERT_NE (type, TYPE_Void) |
893 arg.type = type; |
893 arg.type = type; |
894 |
894 |
895 m_lexer->mustGetNext (Token::Symbol); |
895 m_lexer->mustGetNext (Token::Symbol); |
896 arg.name = m_lexer->token()->text; |
896 arg.name = m_lexer->token()->text; |