--- parser3/src/classes/table.C 2016/11/01 23:10:41 1.338 +++ parser3/src/classes/table.C 2016/12/26 20:37:53 1.340 @@ -22,7 +22,7 @@ #define USE_STRINGSTREAM #endif -volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.338 2016/11/01 23:10:41 moko Exp $"; +volatile const char * IDENT_TABLE_C="$Id: table.C,v 1.340 2016/12/26 20:37:53 moko Exp $"; // class @@ -986,8 +986,8 @@ static void _hash(Request& r, MethodPara throw Exception(PARSER_RUNTIME, 0, "value field(s) must be string or table or code"); } - if(value_type==C_STRING && value_fields.count()!=1) - throw Exception(PARSER_RUNTIME, 0, "you can specify only one value field with option $.type[string]"); + if(value_type==C_STRING && value_fields.count()>1) + throw Exception(PARSER_RUNTIME, 0, "you can't specify more then one value field with option $.type[string]"); { Value* key_param=¶ms[0]; @@ -1044,9 +1044,7 @@ static int sort_cmp_double(const void *a static void _sort(Request& r, MethodParams& params) { Value& key_maker=params.as_junction(0, "key-maker must be code"); - bool reverse=params.count()>1/*..[desc|asc|]*/? - reverse=params.as_no_junction(1, "order must not be code").as_string()=="desc": - false; // default=asc + bool reverse=params.count()>1 /*..[desc|asc|]*/ && params.as_no_junction(1, "order must not be code").as_string()=="desc"; // default=asc Table& old_table=GET_SELF(r, VTable).table(); Table& new_table=*new Table(old_table.columns());