function defineFunction(names, props, handler) {
      if (typeof names === "string") {
          names = [names];
      }
      if (typeof props === "number") {
          props = { numArgs: props };
      }
      // Set default values of functions
      var data = {
          numArgs: props.numArgs,
          argTypes: props.argTypes,
          greediness: props.greediness === undefined ? 1 : props.greediness,
          allowedInText: !!props.allowedInText,
          allowedInMath: props.allowedInMath,
          numOptionalArgs: props.numOptionalArgs || 0,
          infix: !!props.infix,
          handler: handler
      };
      for (var i = 0; i < names.length; ++i) {
          module.exports[names[i]] = data;
      }
  }
/* This file contains a list of functions that we parse, identified by
   * the calls to defineFunction.
   *
   * The first argument to defineFunction is a single name or a list of names.
   * All functions named in such a list will share a single implementation.
   *
   * Each declared function can have associated properties, which
   * include the following:
   *
   *  - numArgs: The number of arguments the function takes.
   *             If this is the only property, it can be passed as a number
   *             instead of an element of a properties object.
   *  - argTypes: (optional) An array corresponding to each argument of the
   *              function, giving the type of argument that should be parsed. Its
   *              length should be equal to `numArgs + numOptionalArgs`. Valid
   *              types:
   *               - "size": A size-like thing, such as "1em" or "5ex"
   *               - "color": An html color, like "#abc" or "blue"
   *               - "original": The same type as the environment that the
   *                             function being parsed is in (e.g. used for the
   *                             bodies of functions like \textcolor where the
   *                             first argument is special and the second
   *                             argument is parsed normally)
   *              Other possible types (probably shouldn't be used)
   *               - "text": Text-like (e.g. \text)
   *               - "math": Normal math
   *              If undefined, this will be treated as an appropriate length
   *              array of "original" strings
   *  - greediness: (optional) The greediness of the function to use ungrouped
   *                arguments.
   *
   *                E.g. if you have an expression
   *                  \sqrt \frac 1 2
   *                since \frac has greediness=2 vs \sqrt's greediness=1, \frac
   *                will use the two arguments '1' and '2' as its two arguments,
   *                then that whole function will be used as the argument to
   *                \sqrt. On the other hand, the expressions
   *                  \frac \frac 1 2 3
   *                and
   *                  \frac \sqrt 1 2
   *                will fail because \frac and \frac have equal greediness
   *                and \sqrt has a lower greediness than \frac respectively. To
   *                make these parse, we would have to change them to:
   *                  \frac {\frac 1 2} 3
   *                and
   *                  \frac {\sqrt 1} 2
   *
   *                The default value is `1`
   *  - allowedInText: (optional) Whether or not the function is allowed inside
   *                   text mode (default false)
   *  - numOptionalArgs: (optional) The number of optional arguments the function
   *                     should parse. If the optional arguments aren't found,
   *                     `null` will be passed to the handler in their place.
   *                     (default 0)
   *  - infix: (optional) Must be true if the function is an infix operator.
   *
   * The last argument is that implementation, the handler for the function(s).
   * It is called to handle these functions and their arguments.
   * It receives two arguments:
   *  - context contains information and references provided by the parser
   *  - args is an array of arguments obtained from TeX input
   * The context contains the following properties:
   *  - funcName: the text (i.e. name) of the function, including \
   *  - parser: the parser object
   *  - lexer: the lexer object
   *  - positions: the positions in the overall string of the function
   *               and the arguments.
   * The latter three should only be used to produce error messages.
   *
   * The function should return an object with the following keys:
   *  - type: The type of element that this is. This is then used in
   *          buildHTML/buildMathML to determine which function
   *          should be called to build this node into a DOM node
   * Any other data can be added to the object, which will be passed
   * in to the function in buildHTML/buildMathML as `group.value`.
   */
This file contains a list of functions that we parse, identified by
the calls to defineFunction.

The first argument to defineFunction is a single name or a list of names.
All functions named in such a list will share a single implementation.

Each declared function can have associated properties, which
include the following.

- numArgs: The number of arguments the function takes.
If this is the only property, it can be passed as a number
instead of an element of a properties object.
- argTypes: (optional) An array corresponding to each argument of the
function, giving the type of argument that should be parsed. Its
length should be equal to `numArgs + numOptionalArgs`.



The default value is `1`
- allowedInText: (optional) Whether or not the function is allowed inside
text mode (default false)
- numOptionalArgs: (optional) The number of optional arguments the function
should parse. If the optional arguments aren't found,
`null` will be passed to the handler in their place.
(default 0)
- infix: (optional) Must be true if the function is an infix operator.

The last argument is that implementation, the handler for the function(s).
It is called to handle these functions and their arguments.

The function should return an object with the following keys:
- type: The type of element that this is. This is then used in
buildHTML/buildMathML to determine which function
should be called to build this node into a DOM node
Any other data can be added to the object, which will be passed
in to the function in buildHTML/buildMathML as `group.value`.
This file contains a list of functions that we parse identified by the calls to defineFunction . The first argument to defineFunction is a single name or a list of names . All functions named in such a list will share a single implementation . Each declared function can have associated properties which include the following . - numArgs : The number of arguments the function takes . If this is the only property it can be passed as a number instead of an element of a properties object . - argTypes : ( optional ) An array corresponding to each argument of the function giving the type of argument that should be parsed . Its length should be equal to ` numArgs + numOptionalArgs ` . The default value is ` 1 ` - allowedInText : ( optional ) Whether or not the function is allowed inside text mode ( default false ) - numOptionalArgs : ( optional ) The number of optional arguments the function should parse . If the optional arguments aren ' t found ` null ` will be passed to the handler in their place . ( default 0 ) - infix : ( optional ) Must be true if the function is an infix operator . The last argument is that implementation the handler for the function ( s ) . It is called to handle these functions and their arguments . The function should return an object with the following keys : - type : The type of element that this is . This is then used in buildHTML / buildMathML to determine which function should be called to build this node into a DOM node Any other data can be added to the object which will be passed in to the function in buildHTML / buildMathML as ` group . value ` .
function defineFunction(names, props, handler) {
      if (typeof names === "string") {
          names = [names];
      }
      if (typeof props === "number") {
          props = { numArgs: props };
      }
      var data = {
          numArgs: props.numArgs,
          argTypes: props.argTypes,
          greediness: props.greediness === undefined ? 1 : props.greediness,
          allowedInText: !!props.allowedInText,
          allowedInMath: props.allowedInMath,
          numOptionalArgs: props.numOptionalArgs || 0,
          infix: !!props.infix,
          handler: handler
      };
      for (var i = 0; i < names.length; ++i) {
          module.exports[names[i]] = data;
      }
  }
function defineFunction ( names , props , handler ) { if ( typeof names === "string" ) { names = [ names ] ; } if ( typeof props === "number" ) { props = { numArgs : props } ; } var data = { numArgs : props . numArgs , argTypes : props . argTypes , greediness : props . greediness === undefined ? 1 : props . greediness , allowedInText : ! ! props . allowedInText , allowedInMath : props . allowedInMath , numOptionalArgs : props . numOptionalArgs || 0 , infix : ! ! props . infix , handler : handler } ; for ( var i = 0 ; i < names . length ; ++ i ) { module . exports [ names [ i ] ] = data ; } }
This file contains a list of functions that we parse, identified by
 the calls to defineFunction.
This file contains a list of functions that we parse identified by the calls to defineFunction .
// Set default values of functions