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

Method name

rhino/src/main/java/org/mozilla/javascript/Parser.java:3740–3760  ·  view source on GitHub ↗
(int ttFlagged, int tt)

Source from the content-addressed store, hash-verified

3738 }
3739
3740 private AstNode name(int ttFlagged, int tt) throws IOException {
3741 String nameString = ts.getString();
3742 int namePos = ts.tokenBeg, nameLineno = lineNumber(), nameColumn = columnNumber();
3743 if (0 != (ttFlagged & TI_CHECK_LABEL) && peekToken() == Token.COLON) {
3744 // Do not consume colon. It is used as an unwind indicator
3745 // to return to statementHelper.
3746 Label label = new Label(namePos, ts.tokenEnd - namePos);
3747 label.setName(nameString);
3748 label.setLineColumnNumber(lineNumber(), columnNumber());
3749 return label;
3750 }
3751 // Not a label. Unfortunately peeking the next token to check for
3752 // a colon has biffed ts.tokenBeg, ts.tokenEnd. We store the name's
3753 // bounds in instance vars and createNameNode uses them.
3754 saveNameTokenData(namePos, nameString, nameLineno, nameColumn);
3755
3756 if (compilerEnv.isXmlAvailable()) {
3757 return propertyName(-1, 0);
3758 }
3759 return createNameNode(true, Token.NAME);
3760 }
3761
3762 /** May return an {@link ArrayLiteral} or {@link ArrayComprehension}. */
3763 private AstNode arrayLiteral() throws IOException {

Callers 1

primaryExprMethod · 0.95

Calls 10

lineNumberMethod · 0.95
columnNumberMethod · 0.95
peekTokenMethod · 0.95
setNameMethod · 0.95
saveNameTokenDataMethod · 0.95
propertyNameMethod · 0.95
createNameNodeMethod · 0.95
setLineColumnNumberMethod · 0.80
isXmlAvailableMethod · 0.80
getStringMethod · 0.45

Tested by

no test coverage detected