commit 975234e8131a5639a738a2d761a44741b8127ad5
parent 09311de8146bfcfb6e93f22efc00ae86aad9e87e
Author: Emily Eisenberg <emily@khanacademy.org>
Date: Mon, 15 Jul 2013 12:06:26 -0700
Fix some minor things
Summary: Fix llap/rlap again, fix lexing errors
Auditors: alpert
Diffstat:
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Lexer.js b/Lexer.js
@@ -62,7 +62,7 @@ Lexer.prototype.lex = function(pos) {
}
// We didn't match any of the tokens, so throw an error.
- throw "Unexpected character: '" + input[0] + "' at position " + this._pos;
+ throw "Unexpected character: '" + input[0] + "' at position " + pos;
};
module.exports = Lexer;
diff --git a/Parser.js b/Parser.js
@@ -337,7 +337,7 @@ Parser.prototype.parseNucleus = function(pos) {
var group = this.parseGroup(nucleus.position);
if (group) {
return new ParseResult(
- new ParseNode(nucleus.type.slice(1), nucleus.text),
+ new ParseNode(nucleus.type.slice(1), group.result),
group.position);
} else {
throw "Parse error: Expected group after '" + nucleus.text + "'";
diff --git a/katex.js b/katex.js
@@ -129,10 +129,10 @@ var buildGroup = function(style, color, group, prev) {
return makeSpan("mord mspace " + spacingClassMap[group.value]);
}
} else if (group.type === "llap") {
- var inner = makeSpan("", buildExpression(style, color, group.value));
+ var inner = makeSpan("", [buildGroup(style, color, group.value)]);
return makeSpan("llap " + style.cls(), [inner]);
} else if (group.type === "rlap") {
- var inner = makeSpan("", buildExpression(style, color, group.value));
+ var inner = makeSpan("", [buildGroup(style, color, group.value)]);
return makeSpan("rlap " + style.cls(), [inner]);
} else if (group.type === "punct") {
return makeSpan("mpunct" + color, [textit(group.value)]);