MCPcopy Index your code
hub / github.com/TruthHun/BookStack / parse

Method parse

static/katex/katex.mjs:14955–14974  ·  view source on GitHub ↗

* Main parsing function, which parses an entire input.

()

Source from the content-addressed store, hash-verified

14953
14954
14955 parse() {
14956 // Create a group namespace for the math expression.
14957 // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
14958 this.gullet.beginGroup(); // Use old \color behavior (same as LaTeX's \textcolor) if requested.
14959 // We do this within the group for the math expression, so it doesn't
14960 // pollute settings.macros.
14961
14962 if (this.settings.colorIsTextColor) {
14963 this.gullet.macros.set("\\color", "\\textcolor");
14964 } // Try to parse the input
14965
14966
14967 this.consume();
14968 const parse = this.parseExpression(false); // If we succeeded, make sure there's an EOF at the end
14969
14970 this.expect("EOF", false); // End the group namespace for the expression
14971
14972 this.gullet.endGroup();
14973 return parse;
14974 }
14975
14976 parseExpression(breakOnInfix, breakOnTokenText) {
14977 const body = []; // Keep adding atoms to the body until we can't parse any more atoms (either

Callers 15

parseTreeFunction · 0.95
parseTree_parseTreeFunction · 0.80
pnFunction · 0.80
uploadImageFunction · 0.80
parseJsonFunction · 0.80
main.jsFile · 0.80
jstree.jsFile · 0.80
jstree.min.jsFile · 0.80
kity.min.jsFile · 0.80
hFunction · 0.80

Calls 6

consumeMethod · 0.95
parseExpressionMethod · 0.95
expectMethod · 0.95
beginGroupMethod · 0.45
setMethod · 0.45
endGroupMethod · 0.45

Tested by

no test coverage detected