From cb666fb24af641f7f595e9b4a60c06047ee6c527 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 9 Aug 2019 21:18:13 +0200 Subject: [PATCH] more header shifting --- archimedean.cpp | 68 +++++++++++- blizzard.cpp | 12 ++- config.cpp | 2 +- expansion.cpp | 121 ++++++++++++++++++--- help.cpp | 12 +++ hyper.h | 277 ------------------------------------------------ hyperpoint.cpp | 4 + multigame.cpp | 30 ++++++ savemem.cpp | 4 + system.cpp | 26 ++--- util.cpp | 31 ++++++ 11 files changed, 278 insertions(+), 309 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index e317ada2..fa071946 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -6,6 +6,70 @@ namespace hr { EX namespace arcm { +#if HDR +struct archimedean_tiling { + + int coloring; + + string symbol; + + vector faces; + vector adj; + vector invert; + vector nflags; + + bool have_ph, have_line, have_symmetry; + int real_faces; + int real_face_type; + + int repetition; + int N; + + ld euclidean_angle_sum; + + vector flags; + + vector>> adjacent; + vector>> triangles; + + void make_match(int a, int i, int b, int j); + void prepare(); + void compute_geometry(); + + void parse(); + void parse(string s) { symbol = s; parse(); } + + ld edgelength; + + vector inradius, circumradius, alphas; + + int matches[30][30]; + int periods[30]; + int tilegroup[30], groupoffset[30], tilegroups; + + int errors; + string errormsg; + + pair& get_adj(heptagon *h, int cid); + pair& get_adj(heptspin hs) { return get_adj(hs.at, hs.spin); } + pair& get_triangle(heptagon *h, int cid); + pair& get_triangle(heptspin hs) { return get_triangle(hs.at, hs.spin); } + pair& get_triangle(const pair& p, int delta = 0); + pair& get_adj(const pair& p, int delta = 0); + + int support_threecolor(); + int support_threecolor_bitruncated(); + int support_football(); + bool support_chessboard(); + void regroup(); + string world_size(); + + eGeometryClass get_class(); + + ld scale(); + }; +#endif + #if CAP_ARCM static const int sfPH = 1; @@ -351,7 +415,7 @@ ld archimedean_tiling::scale() { map > > altmap; -map> archimedean_gmatrix; +EX map> archimedean_gmatrix; hrmap *current_altmap; @@ -703,7 +767,7 @@ transmatrix adjcell_matrix(heptagon *h, int d) { return spin(-t1.first) * xpush(t1.second) * spin(M_PI + t2.first); } -int fix(heptagon *h, int spin) { +EX int fix(heptagon *h, int spin) { int type = isize(current.adjacent[id_of(h)]); spin %= type; if(spin < 0) spin += type; diff --git a/blizzard.cpp b/blizzard.cpp index 687c403c..52aa6d81 100644 --- a/blizzard.cpp +++ b/blizzard.cpp @@ -12,6 +12,10 @@ struct snowball { snowball(int t) { T = rgpushxto0(randomPointIn(t)); phase = randd(); } }; +#if HDR +struct blizzardcell; +#endif + struct blizzardcell { cell *c; int frame; @@ -25,17 +29,17 @@ struct blizzardcell { ~blizzardcell() { for(auto i: inorder) delete i; } }; -map blizzardcells; +EX map blizzardcells; EX void set_blizzard_frame(cell *c, int frameid) { blizzardcells[c].frame = frameid; } -vector bcells; +EX vector bcells; int blizzard_N; -blizzardcell* getbcell(cell *c) { +EX blizzardcell* getbcell(cell *c) { int i = c->listindex; if(i<0 || i >= blizzard_N) return NULL; if(bcells[i]->c != c) return NULL; @@ -205,7 +209,7 @@ EX void drawBlizzards() { #endif } -vector arrowtraps; +EX vector arrowtraps; EX void drawArrowTraps() { for(cell *c: arrowtraps) { diff --git a/config.cpp b/config.cpp index 7c2cced6..7f424da8 100644 --- a/config.cpp +++ b/config.cpp @@ -2213,7 +2213,7 @@ EX int read_gamemode_args() { auto ah_config = addHook(hooks_args, 0, read_config_args) + addHook(hooks_args, 0, read_gamemode_args) + addHook(hooks_args, 0, read_color_args); #endif -unordered_map params = { +EX unordered_map params = { {"linewidth", vid.linewidth}, {"patternlinewidth", linepatterns::width}, {"scale", vid.scale}, diff --git a/expansion.cpp b/expansion.cpp index e31ad72c..01438a27 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -7,6 +7,61 @@ int subtype(cell *c) { return patterns::getpatterninfo(c, patterns::PAT_NONE, 0).id; } +#if HDR +struct bignum { + static const int BASE = 1000000000; + static const long long BASE2 = BASE * (long long)BASE; + vector digits; + bignum() {} + bignum(int i) : digits() { digits.push_back(i); } + void be(int i) { digits.resize(1); digits[0] = i; } + bignum& operator +=(const bignum& b); + void addmul(const bignum& b, int factor); + string get_str(int max_length); + + bool operator < (const bignum&) const; + + ld leading() const { + switch(isize(digits)) { + case 0: + return 0; + case 1: + return digits.back(); + default: + return digits.back() + ld(digits[isize(digits)-2]) / BASE; + } + } + + ld approx() const { + return leading() * pow(BASE, isize(digits) - 1); + } + + ld log_approx() const { + return log(leading()) * log(BASE) * (isize(digits) - 1); + } + + ld operator / (const bignum& b) const { + return leading() / b.leading() * pow(BASE, isize(digits) - isize(b.digits)); + } + + int approx_int() const { + if(isize(digits) > 1) return BASE; + if(digits.empty()) return 0; + return digits[0]; + } + + long long approx_ll() const { + if(isize(digits) > 2) return BASE2; + if(digits.empty()) return 0; + if(isize(digits) == 1) return digits[0]; + return digits[0] + digits[1] * (long long) BASE; + } + + friend inline bignum operator +(bignum a, const bignum& b) { a.addmul(b, 1); return a; } + friend inline bignum operator -(bignum a, const bignum& b) { a.addmul(b, -1); return a; } + }; +#endif + bignum& bignum::operator +=(const bignum& b) { int K = isize(b.digits); if(K > isize(digits)) digits.resize(K); @@ -116,6 +171,40 @@ void canonicize(vector& t) { std::rotate(t.begin()+1, t.begin()+i, t.end()); } +#if HDR +struct expansion_analyzer { + vector gettype(cell *c); + int N; + vector samples; + map, int> codeid; + vector > children; + int rootid, diskid; + int coefficients_known; + vector coef; + int valid_from, tested_to; + ld growth; + + int sample_id(cell *c); + void preliminary_grouping(); + void reduce_grouping(); + vector> descendants; + bignum& get_descendants(int level); + bignum& get_descendants(int level, int type); + void find_coefficients(); + void reset(); + + expansion_analyzer() { reset(); } + + string approximate_descendants(int d, int max_length); + void view_distances_dialog(); + ld get_growth(); + + private: + bool verify(int id); + int valid(int v, int step); + }; +#endif + vector expansion_analyzer::gettype(cell *c) { vector res; res.push_back(subtype(c) * 4 + 2); @@ -445,7 +534,7 @@ int curr_dist(cell *c) { int position; -int type_in_reduced(expansion_analyzer& ea, cell *c, const cellfunction& f) { +EX int type_in_reduced(expansion_analyzer& ea, cell *c, const cellfunction& f) { int a = ea.N; int t = type_in(ea, c, f); if(expansion.N != a) { @@ -457,7 +546,7 @@ int type_in_reduced(expansion_analyzer& ea, cell *c, const cellfunction& f) { // which=1 => right, which=-1 => left -int parent_id(cell *c, int which, const cellfunction& cf) { +EX int parent_id(cell *c, int which, const cellfunction& cf) { int d = cf(c)-1; for(int i=0; itype; i++) { @@ -482,43 +571,49 @@ void generate_around(cell *c) { forCellCM(c2, c) if(c2->mpdist > BARLEV) setdist(c2, BARLEV, c); } -namespace ts { - cell *verified_add(cell *c, int which, int bonus, const cellfunction& cf) { +EX namespace ts { + EX cell *verified_add(cell *c, int which, int bonus, const cellfunction& cf) { int id = parent_id(c, which, cf); if(id == -1) return NULL; return c->cmodmove(id + bonus); } - cell *verified_add_gen(cell *c, int which, int bonus, const cellfunction& cf) { + EX cell *verified_add_gen(cell *c, int which, int bonus, const cellfunction& cf) { return verified_add(c, which, bonus, cf); } - cell *add(cell *c, int which, int bonus, const cellfunction& cf) { + EX cell *add(cell *c, int which, int bonus, const cellfunction& cf) { int pid = parent_id(c, which, cf); if(pid == -1) pid = 0; return c->cmodmove(pid + bonus); } - cell *left_of(cell *c, const cellfunction& cf) { + EX cell *left_of(cell *c, const cellfunction& cf) { int pid = parent_id(c, 1, cf); if(pid == -1) return c; if(VALENCE == 3) return c->cmodmove(pid+1); else return (cellwalker(c, pid) + wstep - 1).cpeek(); } - cell *right_of(cell *c, const cellfunction& cf) { + EX cell *right_of(cell *c, const cellfunction& cf) { int pid = parent_id(c, -1, cf); if(pid == -1) return c; if(VALENCE == 3) return c->cmodmove(pid-1); else return (cellwalker(c, pid) + wstep + 1).cpeek(); } - cell *child_number(cell *c, int id, const cellfunction& cf) { + EX cell *child_number(cell *c, int id, const cellfunction& cf) { int pid = parent_id(c, 1, cf); if(pid == -1) return c->cmove(id); return c->cmodmove(pid + (VALENCE == 3 ? 2 : 1) + id); } - } + + #if HDR + inline cell *left_parent(cell *c, const cellfunction& cf) { return verified_add(c, 1, 0, cf); } + inline cell *right_parent(cell *c, const cellfunction& cf) { return verified_add(c, -1, 0, cf); } + #endif + + EX } bool viewdists = false, use_color_codes = true, use_analyzer = true, show_distance_lists = true; @@ -860,11 +955,11 @@ auto ea_hook = addHook(hooks_args, 100, expansion_readArgs); #endif #endif -expansion_analyzer expansion; +EX expansion_analyzer expansion; -int sibling_limit = 0; +EX int sibling_limit = 0; -void set_sibling_limit() { +EX void set_sibling_limit() { if(0) ; #if CAP_IRR else if(IRREGULAR) sibling_limit = 3; diff --git a/help.cpp b/help.cpp index 4cbc5d59..0a5c2907 100644 --- a/help.cpp +++ b/help.cpp @@ -7,6 +7,18 @@ EX string help; EX function help_delegate; +#if HDR +struct help_extension { + char key; + string text; + string subtext; + color_t color; + reaction_t action; + help_extension() { color = forecolor; } + help_extension(char k, string t, reaction_t a) : key(k), text(t), action(a) { color = forecolor; } + }; +#endif + EX vector help_extensions; vector extra_keys = { diff --git a/hyper.h b/hyper.h index b89dcc6c..c743ddb7 100644 --- a/hyper.h +++ b/hyper.h @@ -3754,27 +3754,7 @@ bool score_loaded(int id); int score_default(int id); void handle_event(SDL_Event& ev); -void start_game(); -void stop_game(); -void switch_game_mode(char switchWhat); - -void stop_game_and_switch_mode(char switchWhat = rg::nothing); // stop_game + switch_game_mode -void restart_game(char switchWhat = rg::nothing); // popAllScreens + popAllGames + stop_game + switch_game_mode + start_game - -// these work as stop_game_and_switch_mode -void set_variation(eVariation); -void set_geometry(eGeometry); - void generate_floorshapes(); -void drawArrowTraps(); -void drawBlizzards(); - -struct blizzardcell; - -extern vector arrowtraps; -extern map blizzardcells; -extern vector bcells; -void set_blizzard_frame(cell *c, int frameid); #define SIDE_SLEV 0 #define SIDE_WTS3 3 @@ -4168,21 +4148,6 @@ struct pathdata { extern int timetowait; -extern vector > airmap; -extern void compute_graphical_distance(); - -struct help_extension { - char key; - string text; - string subtext; - color_t color; - reaction_t action; - help_extension() { color = forecolor; } - help_extension(char k, string t, reaction_t a) : key(k), text(t), action(a) { color = forecolor; } - }; - -extern vector help_extensions; - #define RING(i) for(double i=0; i<=cgi.S84+1e-6; i+=SD3 * pow(.5, vid.linequality)) #define REVRING(i) for(double i=cgi.S84; i>=-1e-6; i-=SD3 * pow(.5, vid.linequality)) #define PRING(i) for(double i=0; i<=cgi.S84+1e-6; i+= pow(.5, vid.linequality)) @@ -4212,81 +4177,6 @@ namespace reg3 { } #endif -namespace arcm { - #if CAP_ARCM - - struct archimedean_tiling { - - int coloring; - - string symbol; - - vector faces; - vector adj; - vector invert; - vector nflags; - - bool have_ph, have_line, have_symmetry; - int real_faces; - int real_face_type; - - int repetition; - int N; - - ld euclidean_angle_sum; - - vector flags; - - vector>> adjacent; - vector>> triangles; - - void make_match(int a, int i, int b, int j); - void prepare(); - void compute_geometry(); - - void parse(); - void parse(string s) { symbol = s; parse(); } - - ld edgelength; - - vector inradius, circumradius, alphas; - - int matches[30][30]; - int periods[30]; - int tilegroup[30], groupoffset[30], tilegroups; - - int errors; - string errormsg; - - pair& get_adj(heptagon *h, int cid); - pair& get_adj(heptspin hs) { return get_adj(hs.at, hs.spin); } - pair& get_triangle(heptagon *h, int cid); - pair& get_triangle(heptspin hs) { return get_triangle(hs.at, hs.spin); } - pair& get_triangle(const pair& p, int delta = 0); - pair& get_adj(const pair& p, int delta = 0); - - int support_threecolor(); - int support_threecolor_bitruncated(); - int support_football(); - bool support_chessboard(); - void regroup(); - string world_size(); - - eGeometryClass get_class(); - - ld scale(); - }; - - extern archimedean_tiling current; - - extern map> archimedean_gmatrix; - - void initialize(heptagon *root); - short& id_of(heptagon *); - int fix(heptagon *h, int spin); - #endif - } - namespace crystal { #if CAP_CRYSTAL static const int MAXDIM = 7; @@ -4328,141 +4218,8 @@ namespace crystal { #endif } -struct bignum { - static const int BASE = 1000000000; - static const long long BASE2 = BASE * (long long)BASE; - vector digits; - bignum() {} - bignum(int i) : digits() { digits.push_back(i); } - void be(int i) { digits.resize(1); digits[0] = i; } - bignum& operator +=(const bignum& b); - void addmul(const bignum& b, int factor); - string get_str(int max_length); - - bool operator < (const bignum&) const; - - ld leading() const { - switch(isize(digits)) { - case 0: - return 0; - case 1: - return digits.back(); - default: - return digits.back() + ld(digits[isize(digits)-2]) / BASE; - } - } - - ld approx() const { - return leading() * pow(BASE, isize(digits) - 1); - } - - ld log_approx() const { - return log(leading()) * log(BASE) * (isize(digits) - 1); - } - - ld operator / (const bignum& b) const { - return leading() / b.leading() * pow(BASE, isize(digits) - isize(b.digits)); - } - - int approx_int() const { - if(isize(digits) > 1) return BASE; - if(digits.empty()) return 0; - return digits[0]; - } - - long long approx_ll() const { - if(isize(digits) > 2) return BASE2; - if(digits.empty()) return 0; - if(isize(digits) == 1) return digits[0]; - return digits[0] + digits[1] * (long long) BASE; - } - - friend inline bignum operator +(bignum a, const bignum& b) { a.addmul(b, 1); return a; } - friend inline bignum operator -(bignum a, const bignum& b) { a.addmul(b, -1); return a; } - }; - -struct expansion_analyzer { - vector gettype(cell *c); - int N; - vector samples; - map, int> codeid; - vector > children; - int rootid, diskid; - int coefficients_known; - vector coef; - int valid_from, tested_to; - ld growth; - - int sample_id(cell *c); - void preliminary_grouping(); - void reduce_grouping(); - vector> descendants; - bignum& get_descendants(int level); - bignum& get_descendants(int level, int type); - void find_coefficients(); - void reset(); - - expansion_analyzer() { reset(); } - - string approximate_descendants(int d, int max_length); - void view_distances_dialog(); - ld get_growth(); - - private: - bool verify(int id); - int valid(int v, int step); - }; - -extern expansion_analyzer expansion; - int towerval(cell *c, const cellfunction& cf); -int parent_id(cell *c, int which, const cellfunction& cf); - -extern int sibling_limit; -extern void set_sibling_limit(); -int type_in_reduced(expansion_analyzer& ea, cell *c, const function& f); - -namespace ts { - cell *verified_add(cell *c, int which, int bonus, const cellfunction& cf); - cell *add(cell *c, int which, int bonus, const cellfunction& cf); - - inline cell *left_parent(cell *c, const cellfunction& cf) { return verified_add(c, 1, 0, cf); } - inline cell *right_parent(cell *c, const cellfunction& cf) { return verified_add(c, -1, 0, cf); } - cell *left_of(cell *c, const cellfunction& cf); - cell *right_of(cell *c, const cellfunction& cf); - cell *child_number(cell *c, int id, const cellfunction& cf); - } - -struct exp_parser { - string s; - int at; - exp_parser() { at = 0; } - - map extra_params; - - bool ok() { return at == isize(s); } - char next(int step=0) { if(at >= isize(s)-step || at == -1) return 0; else return s[at+step]; } - - bool eat(const char *c) { - int orig_at = at; - while(*c && *c == next()) at++, c++; - if(*c == 0) return true; - else at = orig_at; - return false; - } - - cld parse(int prio = 0); - - cld parsepar() { - cld res = parse(); - if(next() != ')') { at = -1; return res; } - at++; - return res; - } - - }; - #if CAP_COMPLEX2 namespace brownian { const int level = 5; @@ -4482,10 +4239,6 @@ namespace brownian { void menuitem_sightrange(char c = 'r'); -static const ld degree = M_PI / 180; - -extern unordered_map params; - namespace dq { extern queue> drawqueue; @@ -4514,34 +4267,6 @@ template void texture_order(const T& f) { } } -struct gamedata { - // important parameters should be visible - eGeometry geo; - eVariation var; - eLand specland; - bool active; - // other properties are recorded - vector record; - int index, mode; - void storegame(); - void restoregame(); - template void store(T& x) { - int ssize = sizeof(x); - if(ssize & 7) ssize = (ssize | 7) + 1; - if(mode == 0) { - record.resize(index+ssize); - T& at = *(new (&record[index]) T()); - at = move(x); - } - else { - T& at = (T&) record[index]; - x = move(at); - at.~T(); - } - index += ssize; - } - }; - /* lastmovetype uses lmSkip, lmMove, lmAttack, lmPush, lmTree */ enum eLastmovetype { lmSkip, lmMove, lmAttack, lmPush, lmTree, lmInstant }; extern eLastmovetype lastmovetype, nextmovetype; @@ -4549,8 +4274,6 @@ extern eLastmovetype lastmovetype, nextmovetype; enum eForcemovetype { fmSkip, fmMove, fmAttack, fmInstant, fmActivate }; extern eForcemovetype forcedmovetype; -static const int PSEUDOKEY_MEMORY = 16397; - static const color_t NOCOLOR = 0; typedef pair euc_pointer; diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 56c48d06..e02a3e91 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -4,6 +4,10 @@ namespace hr { +#if HDR +static const ld degree = M_PI / 180; +#endif + eGeometry geometry; eVariation variation; diff --git a/multigame.cpp b/multigame.cpp index cc0610aa..3ada3824 100644 --- a/multigame.cpp +++ b/multigame.cpp @@ -7,6 +7,36 @@ namespace hr { +#if HDR +struct gamedata { + // important parameters should be visible + eGeometry geo; + eVariation var; + eLand specland; + bool active; + // other properties are recorded + vector record; + int index, mode; + void storegame(); + void restoregame(); + template void store(T& x) { + int ssize = sizeof(x); + if(ssize & 7) ssize = (ssize | 7) + 1; + if(mode == 0) { + record.resize(index+ssize); + T& at = *(new (&record[index]) T()); + at = move(x); + } + else { + T& at = (T&) record[index]; + x = move(at); + at.~T(); + } + index += ssize; + } + }; +#endif + void gamedata_all(gamedata& gd) { gd.index = 0; gd.store(firstland); diff --git a/savemem.cpp b/savemem.cpp index d0c5e46a..fcd20f84 100644 --- a/savemem.cpp +++ b/savemem.cpp @@ -3,6 +3,10 @@ namespace hr { +#if HDR +static const int PSEUDOKEY_MEMORY = 16397; +#endif + bool memory_saving_mode = true; bool show_memory_warning = true; diff --git a/system.cpp b/system.cpp index faf7e70a..aa9b6e52 100644 --- a/system.cpp +++ b/system.cpp @@ -102,7 +102,7 @@ bool trailer_safety = true; hookset *hooks_initgame; // initialize the game -void initgame() { +EX void initgame() { DEBBI(DF_INIT, ("initGame")); callhooks(hooks_initgame); @@ -834,7 +834,7 @@ void remove_emergency_save() { #endif } -void saveStats(bool emergency = false) { +EX void saveStats(bool emergency IS(false)) { DEBBI(DF_INIT, ("saveStats [%s]", scorefile)); if(autocheat) return; @@ -958,7 +958,7 @@ void saveStats(bool emergency = false) { } // load the save -void loadsave() { +EX void loadsave() { if(autocheat) return; #if CAP_TOUR if(tour::on) return; @@ -1088,7 +1088,7 @@ void loadsave() { } #endif -void stop_game() { +EX void stop_game() { if(!game_active) return; if(dual::split(stop_game)) return; DEBBI(DF_INIT, ("stop_game")); @@ -1125,7 +1125,7 @@ void stop_game() { #endif } -void set_geometry(eGeometry target) { +EX void set_geometry(eGeometry target) { if(geometry != target) { int old_DIM = DIM; stop_game(); @@ -1161,7 +1161,7 @@ void set_geometry(eGeometry target) { } } -void set_variation(eVariation target) { +EX void set_variation(eVariation target) { if(variation != target) { stop_game(); if(euclid6 || binarytiling || sol || penrose) geometry = gNormal; @@ -1182,7 +1182,7 @@ void stop_tour() { } } -void switch_game_mode(char switchWhat) { +EX void switch_game_mode(char switchWhat) { DEBBI(DF_INIT, ("switch_game_mode ", switchWhat)); switch(switchWhat) { case rg::peace: @@ -1312,7 +1312,7 @@ void switch_game_mode(char switchWhat) { } } -void start_game() { +EX void start_game() { if(game_active) return; DEBBI(DF_INIT, ("start_game")); if(dual::state == 1) dual::assign_landsides(); @@ -1353,21 +1353,23 @@ void start_game() { subscreens::prepare(); } -void restart_game(char switchWhat) { +// popAllScreens + popAllGames + stop_game + switch_game_mode + start_game +EX void restart_game(char switchWhat IS(rg::nothing)) { popScreenAll(); stop_game(); switch_game_mode(switchWhat); start_game(); } -void stop_game_and_switch_mode(char switchWhat) { +// stop_game + switch_game_mode +EX void stop_game_and_switch_mode(char switchWhat IS(rg::nothing)) { stop_game(); switch_game_mode(switchWhat); } -purehookset clearmemory; +EX purehookset clearmemory; -void clearMemory() { +EX void clearMemory() { callhooks(clearmemory); } diff --git a/util.cpp b/util.cpp index 62d1acbe..ab23432a 100644 --- a/util.cpp +++ b/util.cpp @@ -103,6 +103,37 @@ EX bool appears(const string& haystack, const string& needle) { return simplify(haystack).find(simplify(needle)) != string::npos; } +#if HDR +struct exp_parser { + string s; + int at; + exp_parser() { at = 0; } + + map extra_params; + + bool ok() { return at == isize(s); } + char next(int step=0) { if(at >= isize(s)-step || at == -1) return 0; else return s[at+step]; } + + bool eat(const char *c) { + int orig_at = at; + while(*c && *c == next()) at++, c++; + if(*c == 0) return true; + else at = orig_at; + return false; + } + + cld parse(int prio = 0); + + cld parsepar() { + cld res = parse(); + if(next() != ')') { at = -1; return res; } + at++; + return res; + } + + }; +#endif + cld exp_parser::parse(int prio) { cld res; while(next() == ' ') at++;