157 |
157 |
158 // ============================================================================ |
158 // ============================================================================ |
159 // Get command type by name |
159 // Get command type by name |
160 int GetCommandType (str t) { |
160 int GetCommandType (str t) { |
161 t = t.tolower(); |
161 t = t.tolower(); |
162 return !t.compare ("int") ? TYPE_INT : |
162 return (t == "int") ? TYPE_INT : |
163 !t.compare ("float") ? TYPE_FLOAT : |
163 (t == "float") ? TYPE_FLOAT : |
164 !t.compare ("str") ? TYPE_STRING : |
164 (t == "str") ? TYPE_STRING : |
165 !t.compare ("void") ? TYPE_VOID : |
165 (t == "void") ? TYPE_VOID : |
166 !t.compare ("bool") ? TYPE_BOOL : -1; |
166 (t == "bool") ? TYPE_BOOL : -1; |
167 } |
167 } |
168 |
168 |
169 // ============================================================================ |
169 // ============================================================================ |
170 // Inverse operation - type name by value |
170 // Inverse operation - type name by value |
171 str GetTypeName (int r) { |
171 str GetTypeName (int r) { |