|
|
| version 1.52, 2016/09/19 22:27:57 | version 1.53, 2016/09/20 09:43:05 |
|---|---|
| Line 114 static void _classes(Request& r, MethodP | Line 114 static void _classes(Request& r, MethodP |
| } | } |
| static Value* get_class(Value* value){ | static Value& get_class(Value& value){ |
| if(VStateless_class* result=value->get_class()) | if(VStateless_class* result=value.get_class()) |
| return result; | return *result; |
| else | else { |
| // junction | // we can't return code junction to outside as it's stack value |
| if(Junction *j=value.get_junction()) | |
| if(j->code) | |
| throw Exception(PARSER_RUNTIME, 0, "param must not be code junction"); | |
| // method junction | |
| return value; | return value; |
| } | |
| } | } |
| static const String* get_class_name(Value* value){ | static const String& get_class_name(Value& value){ |
| if(VStateless_class* vclass=value->get_class()) | return *new String(get_class(value).type()); |
| return new String(vclass->type()); | |
| else | |
| // junction | |
| return new String(value->type()); | |
| } | } |
| static void _class(Request& r, MethodParams& params) { | static void _class(Request& r, MethodParams& params) { |
| r.write_no_lang(*get_class(¶ms[0])); | r.write_no_lang(get_class(params[0])); |
| } | } |
| static void _class_name(Request& r, MethodParams& params) { | static void _class_name(Request& r, MethodParams& params) { |
| r.write_no_lang(*get_class_name(¶ms[0])); | r.write_no_lang(get_class_name(params[0])); |
| } | } |
| static void _class_by_name(Request& r, MethodParams& params) { | static void _class_by_name(Request& r, MethodParams& params) { |
| Line 151 static void _class_by_name(Request& r, M | Line 152 static void _class_by_name(Request& r, M |
| static void _base(Request& r, MethodParams& params) { | static void _base(Request& r, MethodParams& params) { |
| if(VStateless_class* vclass=params[0].get_class()) | if(VStateless_class* vclass=params[0].get_class()) |
| if(Value* base=vclass->base()){ | if(Value* base=vclass->base()){ |
| r.write_no_lang(*get_class(base)); | r.write_no_lang(get_class(*base)); |
| return; | return; |
| } | } |
| Line 163 static void _base(Request& r, MethodPara | Line 164 static void _base(Request& r, MethodPara |
| static void _base_name(Request& r, MethodParams& params) { | static void _base_name(Request& r, MethodParams& params) { |
| if(VStateless_class* vclass=params[0].get_class()) | if(VStateless_class* vclass=params[0].get_class()) |
| if(Value* base=vclass->base()) | if(Value* base=vclass->base()) |
| r.write_no_lang(*get_class_name(base)); | r.write_no_lang(get_class_name(*base)); |
| } | } |
| static void _def(Request& r, MethodParams& params) { | static void _def(Request& r, MethodParams& params) { |