diff options
author | Norbert Preining <norbert@preining.info> | 2024-06-23 03:02:33 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2024-06-23 03:02:33 +0000 |
commit | 6abdc79a45a3d88a2e0a33a28a364efdb1f597c5 (patch) | |
tree | 4d5737dc0a85ac1c0845b76a7900d7bb5a2f2d3d /graphics/asymptote/dec.h | |
parent | 4012cf5682cd4d2571914ef5de72cf8b933b4b0f (diff) |
CTAN sync 202406230302
Diffstat (limited to 'graphics/asymptote/dec.h')
-rw-r--r-- | graphics/asymptote/dec.h | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/graphics/asymptote/dec.h b/graphics/asymptote/dec.h index ac6e5b065b..53fee4bfe0 100644 --- a/graphics/asymptote/dec.h +++ b/graphics/asymptote/dec.h @@ -45,9 +45,9 @@ using sym::symbol; class vardec; -class ty : public absyn { +class astType : public absyn { public: - ty(position pos) + astType(position pos) : absyn(pos) {} virtual void prettyprint(ostream &out, Int indent) = 0; @@ -71,15 +71,15 @@ public: #endif }; -class nameTy : public ty { +class nameTy : public astType { name *id; public: nameTy(position pos, name *id) - : ty(pos), id(id) {} + : astType(pos), id(id) {} nameTy(name *id) - : ty(id->getPos()), id(id) {} + : astType(id->getPos()), id(id) {} void prettyprint(ostream &out, Int indent) override; @@ -107,16 +107,16 @@ public: types::array *truetype(types::ty *base, bool tacit=false); }; -class arrayTy : public ty { - ty *cell; +class arrayTy : public astType { + astType *cell; dimensions *dims; public: - arrayTy(position pos, ty *cell, dimensions *dims) - : ty(pos), cell(cell), dims(dims) {} + arrayTy(position pos, astType *cell, dimensions *dims) + : astType(pos), cell(cell), dims(dims) {} arrayTy(name *id, dimensions *dims) - : ty(dims->getPos()), cell(new nameTy(id)), dims(dims) {} + : astType(dims->getPos()), cell(new nameTy(id)), dims(dims) {} void prettyprint(ostream &out, Int indent) override; @@ -129,11 +129,11 @@ public: // Similar to varEntryExp, this helper class always translates to the same // fixed type. -class tyEntryTy : public ty { +class tyEntryTy : public astType { trans::tyEntry *ent; public: tyEntryTy(position pos, trans::tyEntry *ent) - : ty(pos), ent(ent) {} + : astType(pos), ent(ent) {} tyEntryTy(position pos, types::ty *t); @@ -240,12 +240,14 @@ public: void transAsField(coenv &e, record *r) override; bool transAsTemplatedField( - coenv &e, record *r, mem::vector<absyntax::namedTyEntry*>* args + coenv &e, record *r, mem::vector<absyntax::namedTyEntry*>* args, + trans::frame *caller ); void transAsRecordBody(coenv &e, record *r); bool transAsTemplatedRecordBody( - coenv &e, record *r, mem::vector<absyntax::namedTyEntry*> *args + coenv &e, record *r, mem::vector<absyntax::namedTyEntry*> *args, + trans::frame *caller ); types::record *transAsFile(genv& ge, symbol id); @@ -254,7 +256,7 @@ public: genv& ge, symbol id, mem::vector<absyntax::namedTyEntry*> *args, - trans::frame *parent + coenv &e ); // If the block can be interpreted as a single vardec, return that vardec @@ -363,7 +365,7 @@ public: void createSymMap(AsymptoteLsp::SymbolContext* symContext) override; void createSymMapWType( - AsymptoteLsp::SymbolContext* symContext, absyntax::ty* base + AsymptoteLsp::SymbolContext* symContext, absyntax::astType* base ); }; @@ -406,7 +408,7 @@ public: void createSymMap(AsymptoteLsp::SymbolContext* symContext) override; void createSymMapWType( - AsymptoteLsp::SymbolContext* symContext, absyntax::ty* base + AsymptoteLsp::SymbolContext* symContext, absyntax::astType* base ); }; @@ -441,7 +443,7 @@ public: void createSymMap(AsymptoteLsp::SymbolContext* symContext) override; void createSymMapWType( - AsymptoteLsp::SymbolContext* symContext, absyntax::ty* base + AsymptoteLsp::SymbolContext* symContext, absyntax::astType* base ); }; @@ -461,14 +463,14 @@ void createVar(position pos, coenv &e, record *r, symbol id, types::ty *t, varinit *init); class vardec : public dec { - ty *base; + astType *base; decidlist *decs; public: - vardec(position pos, ty *base, decidlist *decs) + vardec(position pos, astType *base, decidlist *decs) : dec(pos), base(base), decs(decs) {} - vardec(position pos, ty *base, decid *di) + vardec(position pos, astType *base, decid *di) : dec(pos), base(base), decs(new decidlist(pos)) { decs->add(di); @@ -634,7 +636,8 @@ public: void add(typeParam *tp); - bool transAsParamMatcher(coenv &e, record *r, mem::vector<namedTyEntry*> *args); + bool transAsParamMatcher(coenv &e, record *r, + mem::vector<namedTyEntry*> *args, trans::frame *caller); void prettyprint(ostream &out, Int indent); }; @@ -644,12 +647,12 @@ class receiveTypedefDec : public dec { typeParamList* params; public: - receiveTypedefDec(position pos, typeParamList* params) + receiveTypedefDec(position pos, typeParamList* params) : dec(pos), params(params) {} void transAsField(coenv& e, record *r) override; bool transAsParamMatcher( - coenv& e, record *r, mem::vector<namedTyEntry*> *args + coenv& e, record *r, mem::vector<namedTyEntry*> *args, trans::frame *caller ); }; @@ -674,7 +677,7 @@ protected: // from a.B unravel x; // // Here, v->getType() will yield A and v->getLocation() will yield the - // location of the the variable a, but the record type t will be B. + // location of the variable a, but the record type t will be B. record *t; varEntry *v; |