MCPcopy Create free account
hub / github.com/mozilla/rhino / xmlElemRef

Method xmlElemRef

rhino/src/main/java/org/mozilla/javascript/Parser.java:3513–3528  ·  view source on GitHub ↗

Parse the [expr] portion of an xml element reference, e.g. @[expr], @ ::[expr], or ns::[expr].

(int atPos, Name namespace, int colonPos)

Source from the content-addressed store, hash-verified

3511 * ns::[expr].
3512 */
3513 private XmlElemRef xmlElemRef(int atPos, Name namespace, int colonPos) throws IOException {
3514 int lb = ts.tokenBeg, rb = -1, pos = atPos != -1 ? atPos : lb;
3515 AstNode expr = expr(false);
3516 int end = getNodeEnd(expr);
3517 if (mustMatchToken(Token.RB, "msg.no.bracket.index", true)) {
3518 rb = ts.tokenBeg;
3519 end = ts.tokenEnd;
3520 }
3521 XmlElemRef ref = new XmlElemRef(pos, end - pos);
3522 ref.setNamespace(namespace);
3523 ref.setColonPos(colonPos);
3524 ref.setAtPos(atPos);
3525 ref.setExpression(expr);
3526 ref.setBrackets(lb, rb);
3527 return ref;
3528 }
3529
3530 private AstNode destructuringAssignExpr() throws IOException, ParserException {
3531 try {

Callers 2

attributeAccessMethod · 0.95
propertyNameMethod · 0.95

Calls 8

exprMethod · 0.95
getNodeEndMethod · 0.95
mustMatchTokenMethod · 0.95
setExpressionMethod · 0.95
setBracketsMethod · 0.95
setColonPosMethod · 0.80
setAtPosMethod · 0.80
setNamespaceMethod · 0.45

Tested by

no test coverage detected