mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 03:08:40 +00:00
Add SourceLocation to encapsulate Token/ParseNode debug information. (#904)
* Add SourceLocation to encapsulate Token/ParseNode debug information. * Specify concrete Token text type as it captures type mismatches. * Responded to comments.
This commit is contained in:
committed by
Kevin Barabash
parent
f10ea4cbeb
commit
59bed2ad08
@@ -61,10 +61,8 @@ const stripPositions = function(expr) {
|
||||
if (typeof expr !== "object" || expr === null) {
|
||||
return expr;
|
||||
}
|
||||
if (expr.lexer && typeof expr.start === "number") {
|
||||
delete expr.lexer;
|
||||
delete expr.start;
|
||||
delete expr.end;
|
||||
if (expr.loc && expr.loc.lexer && typeof expr.loc.start === "number") {
|
||||
delete expr.loc;
|
||||
}
|
||||
Object.keys(expr).forEach(function(key) {
|
||||
stripPositions(expr[key]);
|
||||
|
Reference in New Issue
Block a user