diff options
author | Karl Berry <karl@freefriends.org> | 2010-06-14 23:14:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-06-14 23:14:16 +0000 |
commit | c2175edc7aa44ca0b526f008d473d6f8a8ac4933 (patch) | |
tree | d6c491676b413ad1922481f8c3fc7b64c3afc0a5 /Build/source/utils/asymptote/stm.cc | |
parent | 5d08e9ff4fe5fc836d237ea08e82c82b27d558a2 (diff) |
asy 1.98
git-svn-id: svn://tug.org/texlive/trunk@18982 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/stm.cc')
-rw-r--r-- | Build/source/utils/asymptote/stm.cc | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/Build/source/utils/asymptote/stm.cc b/Build/source/utils/asymptote/stm.cc index c57a41906db..27424bfad6a 100644 --- a/Build/source/utils/asymptote/stm.cc +++ b/Build/source/utils/asymptote/stm.cc @@ -15,6 +15,9 @@ #include "exp.h" #include "stm.h" +#include "symbol.h" +#include "opsymbols.h" + namespace absyntax { using namespace trans; @@ -63,7 +66,7 @@ void expStm::trans(coenv &e) { // give some information. Only do this when the object has a name. void tryToWriteTypeOfExp(types::ty *t, exp *body) { - symbol *name=body->getName(); + symbol name=body->getName(); if (!name) return; @@ -304,7 +307,7 @@ void forStm::trans(coenv &e) void extendedForStm::prettyprint(ostream &out, Int indent) { prettyindent(out, indent); - out << "extendedForStm: '" << *var << "'\n"; + out << "extendedForStm: '" << var << "'\n"; start->prettyprint(out, indent+1); set->prettyprint(out, indent+1); @@ -323,8 +326,8 @@ void extendedForStm::trans(coenv &e) { position pos=getPos(); // Use gensyms for the variable names so as not to pollute the namespace. - symbol *a=symbol::gensym("a"); - symbol *i=symbol::gensym("i"); + symbol a=symbol::gensym("a"); + symbol i=symbol::gensym("i"); // start[] a=set; arrayTy at(pos, start, new dimensions(pos)); @@ -333,7 +336,8 @@ void extendedForStm::trans(coenv &e) { // { start var=a[i]; body } block b(pos); - decid dec2(pos, new decidstart(pos, var), + decid dec2(pos, + new decidstart(pos, var), new subscriptExp(pos, new nameExp(pos, a), new nameExp(pos, i))); b.add(new vardec(pos, start, &dec2)); @@ -343,15 +347,19 @@ void extendedForStm::trans(coenv &e) { // for (int i=0; i < a.length; ++i) // <block> - forStm(pos, new vardec(pos, new tyEntryTy(pos, primInt()), - new decid(pos, new decidstart(pos, i), + forStm(pos, + new vardec(pos, new tyEntryTy(pos, primInt()), + new decid(pos, + new decidstart(pos, i), new intExp(pos, 0))), - new binaryExp(pos, new nameExp(pos, i), - symbol::trans("<"), - new nameExp(pos, new qualifiedName(pos, new simpleName(pos, a), - symbol::trans("length")))), - new expStm(pos, new prefixExp(pos, new nameExp(pos, i), - symbol::trans("+"))), + new binaryExp(pos, + new nameExp(pos, i), + SYM_LT, + new nameExp(pos, + new qualifiedName(pos, + new simpleName(pos, a), + symbol::trans("length")))), + new expStm(pos, new prefixExp(pos, new nameExp(pos, i), SYM_PLUS)), new blockStm(pos, &b)).trans(e); } |