MCPcopy
hub / github.com/facebook/react / parseExpression

Function parseExpression

scripts/babel/transform-test-gate-pragma.js:145–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144 let i = 0;
145 function parseExpression() {
146 let left = parseBinary();
147 while (true) {
148 const token = tokens[i];
149 if (token !== undefined) {
150 switch (token.type) {
151 case '||':
152 case '&&': {
153 i++;
154 const right = parseBinary();
155 if (right === null) {
156 throw Error('Missing expression after ' + token.type);
157 }
158 left = t.logicalExpression(token.type, left, right);
159 continue;
160 }
161 }
162 }
163 break;
164 }
165 return left;
166 }
167
168 function parseBinary() {
169 let left = parseUnary();

Callers 2

parsePrimaryFunction · 0.85
parseFunction · 0.85

Calls 1

parseBinaryFunction · 0.85

Tested by

no test coverage detected