mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Replace ParseNode<*> with a more accurate AnyParseNode and fix flow errors. (#1387)
* Replace ParseNode<*> with a more accurate AnyParseNode and fix flow errors. * Allow "array" environment type spec to use any all symbol type. Before this commit, it was constrained to use "mathord" and "textord", but a recent change in HEAD resulted in a "rel" node being used in the spec for, e.g. \begin{array}{|l||c:r::}\end{array} * Address reviewer comments: rename `lastRow` to `row` in array.js.
This commit is contained in:
committed by
Kevin Barabash
parent
4492eedb68
commit
19d2aa63c3
@@ -1,7 +1,8 @@
|
||||
// @flow
|
||||
import ParseNode from "./ParseNode";
|
||||
import {Token} from "./Token";
|
||||
|
||||
import type {AnyParseNode} from "./ParseNode";
|
||||
|
||||
/**
|
||||
* This is the ParseError class, which is the main error thrown by KaTeX
|
||||
* functions when something has gone wrong. This is used to distinguish internal
|
||||
@@ -15,8 +16,8 @@ class ParseError {
|
||||
// Error position based on passed-in Token or ParseNode.
|
||||
|
||||
constructor(
|
||||
message: string, // The error message
|
||||
token?: Token | ParseNode<*>, // An object providing position information
|
||||
message: string, // The error message
|
||||
token?: ?Token | AnyParseNode, // An object providing position information
|
||||
) {
|
||||
let error = "KaTeX parse error: " + message;
|
||||
let start;
|
||||
|
Reference in New Issue
Block a user