mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-19 19:10:17 +00:00
fix _c
This commit is contained in:
parent
2e38515110
commit
2060b7ba7a
@ -1,3 +1,3 @@
|
||||
rm -rf web/lib/
|
||||
mkdir -p web/lib/
|
||||
emcc src/main.cpp -fexceptions -sEXIT_RUNTIME -O3 -sEXPORTED_FUNCTIONS=_repl_input,_repl_start -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js
|
||||
em++ src/main.cpp -fexceptions -sEXIT_RUNTIME -O3 -sEXPORTED_FUNCTIONS=_repl_input,_repl_start -sEXPORTED_RUNTIME_METHODS=ccall -o web/lib/pocketpy.js
|
38
src/str.h
38
src/str.h
@ -64,7 +64,7 @@ struct _StrLiteral {
|
||||
constexpr _StrLiteral(const char* str, size_t len) : _str(str), _len(len) {}
|
||||
};
|
||||
|
||||
inline constexpr _StrLiteral operator "" c(const char* str, size_t len){
|
||||
inline constexpr _StrLiteral operator "" _c(const char* str, size_t len){
|
||||
return _StrLiteral(str, len);
|
||||
}
|
||||
|
||||
@ -251,32 +251,32 @@ namespace std {
|
||||
};
|
||||
}
|
||||
|
||||
const _Str& __class__ = _Str("__class__"c);
|
||||
const _Str& __base__ = _Str("__base__"c);
|
||||
const _Str& __new__ = _Str("__new__"c);
|
||||
const _Str& __iter__ = _Str("__iter__"c);
|
||||
const _Str& __str__ = _Str("__str__"c);
|
||||
const _Str& __repr__ = _Str("__repr__"c);
|
||||
const _Str& __module__ = _Str("__module__"c);
|
||||
const _Str& __getitem__ = _Str("__getitem__"c);
|
||||
const _Str& __setitem__ = _Str("__setitem__"c);
|
||||
const _Str& __delitem__ = _Str("__delitem__"c);
|
||||
const _Str& __contains__ = _Str("__contains__"c);
|
||||
const _Str& __init__ = _Str("__init__"c);
|
||||
const _Str& __json__ = _Str("__json__"c);
|
||||
const _Str& __name__ = _Str("__name__"c);
|
||||
const _Str& __len__ = _Str("__len__"c);
|
||||
const _Str& __class__ = _Str("__class__"_c);
|
||||
const _Str& __base__ = _Str("__base__"_c);
|
||||
const _Str& __new__ = _Str("__new__"_c);
|
||||
const _Str& __iter__ = _Str("__iter__"_c);
|
||||
const _Str& __str__ = _Str("__str__"_c);
|
||||
const _Str& __repr__ = _Str("__repr__"_c);
|
||||
const _Str& __module__ = _Str("__module__"_c);
|
||||
const _Str& __getitem__ = _Str("__getitem__"_c);
|
||||
const _Str& __setitem__ = _Str("__setitem__"_c);
|
||||
const _Str& __delitem__ = _Str("__delitem__"_c);
|
||||
const _Str& __contains__ = _Str("__contains__"_c);
|
||||
const _Str& __init__ = _Str("__init__"_c);
|
||||
const _Str& __json__ = _Str("__json__"_c);
|
||||
const _Str& __name__ = _Str("__name__"_c);
|
||||
const _Str& __len__ = _Str("__len__"_c);
|
||||
|
||||
const _Str CMP_SPECIAL_METHODS[] = {
|
||||
"__lt__"c, "__le__"c, "__eq__"c, "__ne__"c, "__gt__"c, "__ge__"c
|
||||
"__lt__"_c, "__le__"_c, "__eq__"_c, "__ne__"_c, "__gt__"_c, "__ge__"_c
|
||||
}; // __ne__ should not be used
|
||||
|
||||
const _Str BINARY_SPECIAL_METHODS[] = {
|
||||
"__add__"c, "__sub__"c, "__mul__"c, "__truediv__"c, "__floordiv__"c, "__mod__"c, "__pow__"c
|
||||
"__add__"_c, "__sub__"_c, "__mul__"_c, "__truediv__"_c, "__floordiv__"_c, "__mod__"_c, "__pow__"_c
|
||||
};
|
||||
|
||||
const _Str BITWISE_SPECIAL_METHODS[] = {
|
||||
"__lshift__"c, "__rshift__"c, "__and__"c, "__or__"c, "__xor__"c
|
||||
"__lshift__"_c, "__rshift__"_c, "__and__"_c, "__or__"_c, "__xor__"_c
|
||||
};
|
||||
|
||||
const uint32_t __LoRangeA[] = {170,186,443,448,660,1488,1519,1568,1601,1646,1649,1749,1774,1786,1791,1808,1810,1869,1969,1994,2048,2112,2144,2208,2230,2308,2365,2384,2392,2418,2437,2447,2451,2474,2482,2486,2493,2510,2524,2527,2544,2556,2565,2575,2579,2602,2610,2613,2616,2649,2654,2674,2693,2703,2707,2730,2738,2741,2749,2768,2784,2809,2821,2831,2835,2858,2866,2869,2877,2908,2911,2929,2947,2949,2958,2962,2969,2972,2974,2979,2984,2990,3024,3077,3086,3090,3114,3133,3160,3168,3200,3205,3214,3218,3242,3253,3261,3294,3296,3313,3333,3342,3346,3389,3406,3412,3423,3450,3461,3482,3507,3517,3520,3585,3634,3648,3713,3716,3718,3724,3749,3751,3762,3773,3776,3804,3840,3904,3913,3976,4096,4159,4176,4186,4193,4197,4206,4213,4238,4352,4682,4688,4696,4698,4704,4746,4752,4786,4792,4800,4802,4808,4824,4882,4888,4992,5121,5743,5761,5792,5873,5888,5902,5920,5952,5984,5998,6016,6108,6176,6212,6272,6279,6314,6320,6400,6480,6512,6528,6576,6656,6688,6917,6981,7043,7086,7098,7168,7245,7258,7401,7406,7413,7418,8501,11568,11648,11680,11688,11696,11704,11712,11720,11728,11736,12294,12348,12353,12447,12449,12543,12549,12593,12704,12784,13312,19968,40960,40982,42192,42240,42512,42538,42606,42656,42895,42999,43003,43011,43015,43020,43072,43138,43250,43259,43261,43274,43312,43360,43396,43488,43495,43514,43520,43584,43588,43616,43633,43642,43646,43697,43701,43705,43712,43714,43739,43744,43762,43777,43785,43793,43808,43816,43968,44032,55216,55243,63744,64112,64285,64287,64298,64312,64318,64320,64323,64326,64467,64848,64914,65008,65136,65142,65382,65393,65440,65474,65482,65490,65498,65536,65549,65576,65596,65599,65616,65664,66176,66208,66304,66349,66370,66384,66432,66464,66504,66640,66816,66864,67072,67392,67424,67584,67592,67594,67639,67644,67647,67680,67712,67808,67828,67840,67872,67968,68030,68096,68112,68117,68121,68192,68224,68288,68297,68352,68416,68448,68480,68608,68864,69376,69415,69424,69600,69635,69763,69840,69891,69956,69968,70006,70019,70081,70106,70108,70144,70163,70272,70280,70282,70287,70303,70320,70405,70415,70419,70442,70450,70453,70461,70480,70493,70656,70727,70751,70784,70852,70855,71040,71128,71168,71236,71296,71352,71424,71680,71935,72096,72106,72161,72163,72192,72203,72250,72272,72284,72349,72384,72704,72714,72768,72818,72960,72968,72971,73030,73056,73063,73066,73112,73440,73728,74880,77824,82944,92160,92736,92880,92928,93027,93053,93952,94032,94208,100352,110592,110928,110948,110960,113664,113776,113792,113808,123136,123214,123584,124928,126464,126469,126497,126500,126503,126505,126516,126521,126523,126530,126535,126537,126539,126541,126545,126548,126551,126553,126555,126557,126559,126561,126564,126567,126572,126580,126585,126590,126592,126603,126625,126629,126635,131072,173824,177984,178208,183984,194560};
|
||||
|
2
src/vm.h
2
src/vm.h
@ -693,7 +693,7 @@ public:
|
||||
this->True = newObject(_tp_bool, true);
|
||||
this->False = newObject(_tp_bool, false);
|
||||
this->builtins = newModule("builtins");
|
||||
this->_main = newModule("__main__"c, false);
|
||||
this->_main = newModule("__main__"_c, false);
|
||||
|
||||
setAttr(_tp_type, __base__, _tp_object);
|
||||
_tp_type->setType(_tp_type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user