function parseImplicitGroup() {
              var start = this.parseSymbol();

              if (start == null) {
                  // If we didn't get anything we handle, fall back to parseFunction
                  return this.parseFunction();
              }

              var func = start.result;

              if (func === "\\left") {
                  // If we see a left:
                  // Parse the entire left function (including the delimiter)
                  var left = this.parseFunction(start);
                  // Parse out the implicit body
                  ++this.leftrightDepth;
                  var body = this.parseExpression(false);
                  --this.leftrightDepth;
                  // Check the next token
                  this.expect("\\right", false);
                  var right = this.parseFunction();
                  return new _ParseNode2.default("leftright", {
                      body: body,
                      left: left.value.value,
                      right: right.value.value
                  }, this.mode);
              } else if (func === "\\begin") {
                  // begin...end is similar to left...right
                  var begin = this.parseFunction(start);
                  var envName = begin.value.name;
                  if (!_environments2.default.hasOwnProperty(envName)) {
                      throw new _ParseError2.default("No such environment: " + envName, begin.value.nameGroup);
                  }
                  // Build the environment object. Arguments and other information will
                  // be made available to the begin and end methods using properties.
                  var env = _environments2.default[envName];
                  var args = this.parseArguments("\\begin{" + envName + "}", env);
                  var context = {
                      mode: this.mode,
                      envName: envName,
                      parser: this,
                      positions: args.pop()
                  };
                  var result = env.handler(context, args);
                  this.expect("\\end", false);
                  var endNameToken = this.nextToken;
                  var end = this.parseFunction();
                  if (end.value.name !== envName) {
                      throw new _ParseError2.default("Mismatch: \\begin{" + envName + "} matched " + "by \\end{" + end.value.name + "}", endNameToken);
                  }
                  result.position = end.position;
                  return result;
              } else if (_utils2.default.contains(Parser.sizeFuncs, func)) {
                  // If we see a sizing function, parse out the implicit body
                  this.consumeSpaces();
                  var _body = this.parseExpression(false);
                  return new _ParseNode2.default("sizing", {
                      // Figure out what size to use based on the list of functions above
                      size: _utils2.default.indexOf(Parser.sizeFuncs, func) + 1,
                      value: _body
                  }, this.mode);
              } else if (_utils2.default.contains(Parser.styleFuncs, func)) {
                  // If we see a styling function, parse out the implicit body
                  this.consumeSpaces();
                  var _body2 = this.parseExpression(true);
                  return new _ParseNode2.default("styling", {
                      // Figure out what style to use by pulling out the style from
                      // the function name
                      style: func.slice(1, func.length - 5),
                      value: _body2
                  }, this.mode);
              } else if (func in Parser.oldFontFuncs) {
                  var style = Parser.oldFontFuncs[func];
                  // If we see an old font function, parse out the implicit body
                  this.consumeSpaces();
                  var _body3 = this.parseExpression(true);
                  if (style.slice(0, 4) === 'text') {
                      return new _ParseNode2.default("text", {
                          style: style,
                          body: new _ParseNode2.default("ordgroup", _body3, this.mode)
                      }, this.mode);
                  } else {
                      return new _ParseNode2.default("font", {
                          font: style,
                          body: new _ParseNode2.default("ordgroup", _body3, this.mode)
                      }, this.mode);
                  }
              } else if (func === "\\color") {
                  // If we see a styling function, parse out the implicit body
                  var color = this.parseColorGroup(false);
                  if (!color) {
                      throw new _ParseError2.default("\\color not followed by color");
                  }
                  var _body4 = this.parseExpression(true);
                  return new _ParseNode2.default("color", {
                      type: "color",
                      color: color.result.value,
                      value: _body4
                  }, this.mode);
              } else if (func === "$") {
                  if (this.mode === "math") {
                      throw new _ParseError2.default("$ within math mode");
                  }
                  this.consume();
                  var outerMode = this.mode;
                  this.switchMode("math");
                  var _body5 = this.parseExpression(false, "$");
                  this.expect("$", true);
                  this.switchMode(outerMode);
                  return new _ParseNode2.default("styling", {
                      style: "text",
                      value: _body5
                  }, "math");
              } else {
                  // Defer to parseFunction if it's not a function we handle
                  return this.parseFunction(start);
              }
          }
/**
           * Parses an implicit group, which is a group that starts at the end of a
           * specified, and ends right before a higher explicit group ends, or at EOL. It
           * is used for functions that appear to affect the current style, like \Large or
           * \textrm, where instead of keeping a style we just pretend that there is an
           * implicit grouping after it until the end of the group. E.g.
           *   small text {\Large large text} small text again
           * It is also used for \left and \right to get the correct grouping.
           *
           * @return {?ParseNode}
           */
Parses an implicit group, which is a group that starts at the end of a
specified, and ends right before a higher explicit group ends, or at EOL. It
is used for functions that appear to affect the current style, like \Large or
\textrm, where instead of keeping a style we just pretend that there is an
implicit grouping after it until the end of the group.


Parses an implicit group which is a group that starts at the end of a specified and ends right before a higher explicit group ends or at EOL . It is used for functions that appear to affect the current style like \ Large or \ textrm where instead of keeping a style we just pretend that there is an implicit grouping after it until the end of the group .
function parseImplicitGroup() {
              var start = this.parseSymbol();
              if (start == null) {
                  return this.parseFunction();
              }
              var func = start.result;
              if (func === "\\left") {
                  var left = this.parseFunction(start);
                  ++this.leftrightDepth;
                  var body = this.parseExpression(false);
                  --this.leftrightDepth;
                  this.expect("\\right", false);
                  var right = this.parseFunction();
                  return new _ParseNode2.default("leftright", {
                      body: body,
                      left: left.value.value,
                      right: right.value.value
                  }, this.mode);
              } else if (func === "\\begin") {
                  var begin = this.parseFunction(start);
                  var envName = begin.value.name;
                  if (!_environments2.default.hasOwnProperty(envName)) {
                      throw new _ParseError2.default("No such environment: " + envName, begin.value.nameGroup);
                  }
                  var env = _environments2.default[envName];
                  var args = this.parseArguments("\\begin{" + envName + "}", env);
                  var context = {
                      mode: this.mode,
                      envName: envName,
                      parser: this,
                      positions: args.pop()
                  };
                  var result = env.handler(context, args);
                  this.expect("\\end", false);
                  var endNameToken = this.nextToken;
                  var end = this.parseFunction();
                  if (end.value.name !== envName) {
                      throw new _ParseError2.default("Mismatch: \\begin{" + envName + "} matched " + "by \\end{" + end.value.name + "}", endNameToken);
                  }
                  result.position = end.position;
                  return result;
              } else if (_utils2.default.contains(Parser.sizeFuncs, func)) {
                  this.consumeSpaces();
                  var _body = this.parseExpression(false);
                  return new _ParseNode2.default("sizing", {
                      size: _utils2.default.indexOf(Parser.sizeFuncs, func) + 1,
                      value: _body
                  }, this.mode);
              } else if (_utils2.default.contains(Parser.styleFuncs, func)) {
                  this.consumeSpaces();
                  var _body2 = this.parseExpression(true);
                  return new _ParseNode2.default("styling", {
                      style: func.slice(1, func.length - 5),
                      value: _body2
                  }, this.mode);
              } else if (func in Parser.oldFontFuncs) {
                  var style = Parser.oldFontFuncs[func];
                  this.consumeSpaces();
                  var _body3 = this.parseExpression(true);
                  if (style.slice(0, 4) === 'text') {
                      return new _ParseNode2.default("text", {
                          style: style,
                          body: new _ParseNode2.default("ordgroup", _body3, this.mode)
                      }, this.mode);
                  } else {
                      return new _ParseNode2.default("font", {
                          font: style,
                          body: new _ParseNode2.default("ordgroup", _body3, this.mode)
                      }, this.mode);
                  }
              } else if (func === "\\color") {
                  var color = this.parseColorGroup(false);
                  if (!color) {
                      throw new _ParseError2.default("\\color not followed by color");
                  }
                  var _body4 = this.parseExpression(true);
                  return new _ParseNode2.default("color", {
                      type: "color",
                      color: color.result.value,
                      value: _body4
                  }, this.mode);
              } else if (func === "$") {
                  if (this.mode === "math") {
                      throw new _ParseError2.default("$ within math mode");
                  }
                  this.consume();
                  var outerMode = this.mode;
                  this.switchMode("math");
                  var _body5 = this.parseExpression(false, "$");
                  this.expect("$", true);
                  this.switchMode(outerMode);
                  return new _ParseNode2.default("styling", {
                      style: "text",
                      value: _body5
                  }, "math");
              } else {
                  return this.parseFunction(start);
              }
          }
function parseImplicitGroup ( ) { var start = this . parseSymbol ( ) ; if ( start == null ) { return this . parseFunction ( ) ; } var func = start . result ; if ( func === "\\left" ) { var left = this . parseFunction ( start ) ; ++ this . leftrightDepth ; var body = this . parseExpression ( false ) ; -- this . leftrightDepth ; this . expect ( "\\right" , false ) ; var right = this . parseFunction ( ) ; return new _ParseNode2 . default ( "leftright" , { body : body , left : left . value . value , right : right . value . value } , this . mode ) ; } else if ( func === "\\begin" ) { var begin = this . parseFunction ( start ) ; var envName = begin . value . name ; if ( ! _environments2 . default . hasOwnProperty ( envName ) ) { throw new _ParseError2 . default ( "No such environment: " + envName , begin . value . nameGroup ) ; } var env = _environments2 . default [ envName ] ; var args = this . parseArguments ( "\\begin{" + envName + "}" , env ) ; var context = { mode : this . mode , envName : envName , parser : this , positions : args . pop ( ) } ; var result = env . handler ( context , args ) ; this . expect ( "\\end" , false ) ; var endNameToken = this . nextToken ; var end = this . parseFunction ( ) ; if ( end . value . name !== envName ) { throw new _ParseError2 . default ( "Mismatch: \\begin{" + envName + "} matched " + "by \\end{" + end . value . name + "}" , endNameToken ) ; } result . position = end . position ; return result ; } else if ( _utils2 . default . contains ( Parser . sizeFuncs , func ) ) { this . consumeSpaces ( ) ; var _body = this . parseExpression ( false ) ; return new _ParseNode2 . default ( "sizing" , { size : _utils2 . default . indexOf ( Parser . sizeFuncs , func ) + 1 , value : _body } , this . mode ) ; } else if ( _utils2 . default . contains ( Parser . styleFuncs , func ) ) { this . consumeSpaces ( ) ; var _body2 = this . parseExpression ( true ) ; return new _ParseNode2 . default ( "styling" , { style : func . slice ( 1 , func . length - 5 ) , value : _body2 } , this . mode ) ; } else if ( func in Parser . oldFontFuncs ) { var style = Parser . oldFontFuncs [ func ] ; this . consumeSpaces ( ) ; var _body3 = this . parseExpression ( true ) ; if ( style . slice ( 0 , 4 ) === 'text' ) { return new _ParseNode2 . default ( "text" , { style : style , body : new _ParseNode2 . default ( "ordgroup" , _body3 , this . mode ) } , this . mode ) ; } else { return new _ParseNode2 . default ( "font" , { font : style , body : new _ParseNode2 . default ( "ordgroup" , _body3 , this . mode ) } , this . mode ) ; } } else if ( func === "\\color" ) { var color = this . parseColorGroup ( false ) ; if ( ! color ) { throw new _ParseError2 . default ( "\\color not followed by color" ) ; } var _body4 = this . parseExpression ( true ) ; return new _ParseNode2 . default ( "color" , { type : "color" , color : color . result . value , value : _body4 } , this . mode ) ; } else if ( func === "$" ) { if ( this . mode === "math" ) { throw new _ParseError2 . default ( "$ within math mode" ) ; } this . consume ( ) ; var outerMode = this . mode ; this . switchMode ( "math" ) ; var _body5 = this . parseExpression ( false , "$" ) ; this . expect ( "$" , true ) ; this . switchMode ( outerMode ) ; return new _ParseNode2 . default ( "styling" , { style : "text" , value : _body5 } , "math" ) ; } else { return this . parseFunction ( start ) ; } }
Parses an implicit group, which is a group that starts at the end of a
 specified, and ends right before a higher explicit group ends, or at EOL.
Parses an implicit group which is a group that starts at the end of a specified and ends right before a higher explicit group ends or at EOL .
// If we didn't get anything we handle, fall back to parseFunction // If we see a left: // Parse the entire left function (including the delimiter) // Parse out the implicit body // Check the next token // begin...end is similar to left...right // Build the environment object. Arguments and other information will // be made available to the begin and end methods using properties. // If we see a sizing function, parse out the implicit body // Figure out what size to use based on the list of functions above // If we see a styling function, parse out the implicit body // Figure out what style to use by pulling out the style from // the function name // If we see an old font function, parse out the implicit body // If we see a styling function, parse out the implicit body // Defer to parseFunction if it's not a function we handle