@@ -26,11 +26,11 @@ Lexer.prototype.expect = function(type, text) {
2626 // The next atom is NOT of the right type
2727 if ( nextAtom . type !== type )
2828 throw new ParseError ( 'Expect an atom of ' + type + ' but received ' +
29- nextAtom . type , this . _pos , this . _input ) ;
29+ nextAtom . type , this . _pos , this . _input ) ;
3030 // Check whether the text is exactly the same
3131 if ( ! this . _matchText ( text ) )
32- throw new ParseError ( 'Expect `' + text + '` but received `' +
33- nextAtom . text + '`' , this . _pos , this . _input ) ;
32+ throw new ParseError ( 'Expect `' + text + '` but received `' +
33+ nextAtom . text + '`' , this . _pos , this . _input ) ;
3434
3535 this . _next ( ) ;
3636 return this . _currentAtom . text ;
@@ -48,7 +48,7 @@ var mathPattern = {
4848 exec : function ( str ) {
4949 var delimiters = [
5050 { start : '$' , end : '$' } ,
51- { start : '\\(' , end : '\\)' }
51+ { start : '\\(' , end : '\\)' } ,
5252 ] ;
5353 var totalLen = str . length ;
5454
@@ -62,7 +62,8 @@ var mathPattern = {
6262 while ( endPos < totalLen ) {
6363 var pos = remain . indexOf ( endDel ) ;
6464 if ( pos < 0 )
65- throw new ParseError ( 'Math environment is not closed' , this . _pos , this . _input ) ;
65+ throw new ParseError ( 'Math environment is not closed' ,
66+ this . _pos , this . _input ) ;
6667
6768 // false positive, it's escaped, not a match
6869 if ( pos > 0 && remain [ pos - 1 ] === '\\' ) {
@@ -73,13 +74,13 @@ var mathPattern = {
7374 }
7475
7576 var res = [ str . slice ( 0 , endPos + pos + endDel . length ) ,
76- str . slice ( startDel . length , endPos + pos ) ] ;
77+ str . slice ( startDel . length , endPos + pos ) ] ;
7778 return res ;
7879 }
7980 }
8081
8182 return null ;
82- }
83+ } ,
8384} ;
8485var atomRegex = {
8586 // TODO: which is correct? func: /^\\(?:[a-zA-Z]+|.)/,
@@ -89,7 +90,7 @@ var atomRegex = {
8990 open : / ^ \{ / ,
9091 close : / ^ \} / ,
9192 quote : / ^ ( ` | ` ` | ' | ' ' ) / ,
92- ordinary : / ^ [ ^ \\ { } $ & # % _ \s ] + /
93+ ordinary : / ^ [ ^ \\ { } $ & # % _ \s ] + / ,
9394} ;
9495var commentRegex = / ^ % .* / ;
9596var whitespaceRegex = / ^ \s + / ;
@@ -126,7 +127,7 @@ Lexer.prototype._next = function() {
126127 this . _nextAtom = {
127128 type : 'EOF' ,
128129 text : null ,
129- whitespace : false
130+ whitespace : false ,
130131 } ;
131132 return false ;
132133 }
@@ -145,7 +146,7 @@ Lexer.prototype._next = function() {
145146 this . _nextAtom = {
146147 type : type , /* special, func, open, close, ordinary, math */
147148 text : usefulText , /* the text value of the atom */
148- whitespace : anyWhitespace /* any whitespace before the atom */
149+ whitespace : anyWhitespace , /* any whitespace before the atom */
149150 } ;
150151
151152 this . _pos += matchText . length ;
0 commit comments