|
|
| version 1.78, 2026/01/06 16:36:38 | version 1.80, 2026/05/06 20:19:02 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b double parser class. | Parser: @b double parser class. |
| Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2026 Art. Lebedev Studio (https://www.artlebedev.com) |
| Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru> | Authors: Konstantin Morshnev <moko@design.ru>, Alexandr Petrosian <paf@design.ru> |
| */ | */ |
| Line 67 static void _mul(Request& r, MethodParam | Line 67 static void _mul(Request& r, MethodParam |
| static void _div(Request& r, MethodParams& params) { vdouble_op(r, params, &__div); } | static void _div(Request& r, MethodParams& params) { vdouble_op(r, params, &__div); } |
| static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } | static void _mod(Request& r, MethodParams& params) { vdouble_op(r, params, &__mod); } |
| static void _plus_plus(Request& r, MethodParams& params) { | |
| VDouble& vdouble=GET_SELF(r, VDouble); | |
| r.write(*new VDouble(vdouble)); | |
| vdouble.inc(1); | |
| } | |
| static void _minus_minus(Request& r, MethodParams& params) { | |
| VDouble& vdouble=GET_SELF(r, VDouble); | |
| r.write(*new VDouble(vdouble)); | |
| vdouble.inc(-1); | |
| } | |
| // from string.C | // from string.C |
| extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); | extern const String* sql_result_string(Request& r, MethodParams& params, Value*& default_code); |
| Line 96 MDouble::MDouble(): Methoded("double") { | Line 108 MDouble::MDouble(): Methoded("double") { |
| // ^double.bool[] | // ^double.bool[] |
| // ^double.bool[default for ^string.bool compatibility] | // ^double.bool[default for ^string.bool compatibility] |
| add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); | add_native_method("bool", Method::CT_DYNAMIC, _bool, 0, 1); |
| // ^double.inc[] | // ^double.inc[] |
| // ^double.inc[offset] | // ^double.inc[offset] |
| add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); | add_native_method("inc", Method::CT_DYNAMIC, _inc, 0, 1); |
| // ^double.dec[] | // ^double.dec[] |
| // ^double.dec[offset] | // ^double.dec[offset] |
| add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); | add_native_method("dec", Method::CT_DYNAMIC, _dec, 0, 1); |
| // ^double.mul[k] | |
| // ^double.++[] | |
| add_native_method("++", Method::CT_DYNAMIC, _plus_plus, 0, 0); | |
| // ^double.--[] | |
| add_native_method("--", Method::CT_DYNAMIC, _minus_minus, 0, 0); | |
| // ^double.mul[k] | |
| add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); | add_native_method("mul", Method::CT_DYNAMIC, _mul, 1, 1); |
| // ^double.div[d] | // ^double.div[d] |
| add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); | add_native_method("div", Method::CT_DYNAMIC, _div, 1, 1); |
| Line 112 MDouble::MDouble(): Methoded("double") { | Line 130 MDouble::MDouble(): Methoded("double") { |
| // ^double.format{format} | // ^double.format{format} |
| add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); | add_native_method("format", Method::CT_DYNAMIC, _string_format, 1, 1); |
| // ^sql[query] | // ^sql[query] |
| // ^sql[query][$.limit(1) $.offset(2) $.default(0.0)] | // ^sql[query][$.limit(1) $.offset(2) $.default(0.0)] |
| add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); | add_native_method("sql", Method::CT_STATIC, _sql, 1, 2); |