add:   if (this.string.slice(this.i,this.i+5) == "begin") {pcount++; this.i+=4} else if (this.string.slice(this.i,this.i+3) == "end") { if (pcount > 0) {pcount--; this.i += 2} } 
context:   GetUpto: function (name,token) {    while (this.nextIsSpace()) {this.i++}    var start = this.i; var pcount = 0;    while (this.i < this.string.length) {      var c = this.string.charAt(this.i++);      if (c == '{') {pcount++}      else if (c == '}') {        if (pcount == 0)          {this.Error("Extra close brace while looking for "+this.cmd+token); return}        pcount --;      } else if (c == this.cmd) {        if (pcount == 0)  {          if (this.string.slice(this.i,this.i+token.length) == token) {            c = this.string.charAt(this.i+token.length);            if (c.match(/[^a-z]/i) || !token.match(/[a-z]/i)) {              var arg = this.string.slice(start,this.i-1);              this.i += token.length;              return arg;            }          }        }        this.i++;      }    }    this.Error("Couldn't find "+this.cmd+token+" for "+name);  },
meta: 7708	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/7708/5299d4576f9c235bc73d0b93eecbbf62930b0b49/jsMath.js/clean/htdocs/jsMath/jsMath.js