MCPcopy
hub / github.com/KhronosGroup/Vulkan-Docs / parse

Method parse

katex/katex.js:17728–17756  ·  view source on GitHub ↗

* Main parsing function, which parses an entire input.

()

Source from the content-addressed store, hash-verified

17726
17727
17728 parse() {
17729 if (!this.settings.globalGroup) {
17730 // Create a group namespace for the math expression.
17731 // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
17732 this.gullet.beginGroup();
17733 } // Use old \color behavior (same as LaTeX's \textcolor) if requested.
17734 // We do this within the group for the math expression, so it doesn't
17735 // pollute settings.macros.
17736
17737
17738 if (this.settings.colorIsTextColor) {
17739 this.gullet.macros.set("\\color", "\\textcolor");
17740 }
17741
17742 try {
17743 // Try to parse the input
17744 const parse = this.parseExpression(false); // If we succeeded, make sure there's an EOF at the end
17745
17746 this.expect("EOF"); // End the group namespace for the expression
17747
17748 if (!this.settings.globalGroup) {
17749 this.gullet.endGroup();
17750 }
17751
17752 return parse; // Close any leftover groups in case of a parse error.
17753 } finally {
17754 this.gullet.endGroups();
17755 }
17756 }
17757 /**
17758 * Fully parse a separate sequence of tokens as a separate job.
17759 * Tokens should be specified in reverse order, as in a MacroDefinition.

Callers 15

parseTreeFunction · 0.95
__init__Method · 0.45
testVulkanObjectFunction · 0.45
testVulkanObjectSCFunction · 0.45
genvk.pyFile · 0.45
indexExt.pyFile · 0.45

Calls 6

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

Tested by 4

testVulkanObjectFunction · 0.36
testVulkanObjectSCFunction · 0.36