MCPcopy
hub / github.com/josdejong/mathjs / parseParentheses

Function parseParentheses

src/expression/parse.js:1764–1787  ·  view source on GitHub ↗

* parentheses * @return {Node} node * @private

(state)

Source from the content-addressed store, hash-verified

1762 * @private
1763 */
1764 function parseParentheses (state) {
1765 let node
1766
1767 // check if it is a parenthesized expression
1768 if (state.token === '(') {
1769 // parentheses (...)
1770 openParams(state)
1771 getToken(state)
1772
1773 node = parseAssignment(state) // start again
1774
1775 if (state.token !== ')') {
1776 throw createSyntaxError(state, 'Parenthesis ) expected')
1777 }
1778 closeParams(state)
1779 getToken(state)
1780
1781 node = new ParenthesisNode(node)
1782 node = parseAccessors(state, node)
1783 return node
1784 }
1785
1786 return parseEnd(state)
1787 }
1788
1789 /**
1790 * Evaluated when the expression is not yet ended but expected to end

Callers 1

parseNumberFunction · 0.85

Calls 7

openParamsFunction · 0.85
getTokenFunction · 0.85
parseAssignmentFunction · 0.85
createSyntaxErrorFunction · 0.85
closeParamsFunction · 0.85
parseAccessorsFunction · 0.85
parseEndFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…