Khan/KaTeX — pull request #93 by kevinb7 (2014-09-20 06:18:19+00:00)
Title: Parser cleanup

I'd like to implement \def, but it will require changes to the parser. Before starting that work I thought I'd clean up the parser a bit. Here's a list of things I was trying to accomplish with these changes:
- improve consistency by having all parseBlah functions return ParseResult objects removing the need for ParseFuncOrArgument
- reduce ambiguity through improved naming, e.g. LexResult -> Token, func -> funcName when it's a string vs. func staying a func when it's a object
- reduce complexity by extracting methods, e.g. parseLeftRight and parseArgument