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

Method recordComment

rhino/src/main/java/org/mozilla/javascript/Parser.java:399–413  ·  view source on GitHub ↗
(int lineno, int column, String comment)

Source from the content-addressed store, hash-verified

397 }
398
399 private void recordComment(int lineno, int column, String comment) {
400 if (scannedComments == null) {
401 scannedComments = new ArrayList<>();
402 }
403 Comment commentNode =
404 new Comment(ts.tokenBeg, ts.getTokenLength(), ts.commentType, comment);
405 if (ts.commentType == Token.CommentType.JSDOC
406 && compilerEnv.isRecordingLocalJsDocComments()) {
407 currentJsDocComment =
408 new Comment(ts.tokenBeg, ts.getTokenLength(), ts.commentType, comment);
409 currentJsDocComment.setLineColumnNumber(lineno, column);
410 }
411 commentNode.setLineColumnNumber(lineno, column);
412 scannedComments.add(commentNode);
413 }
414
415 private Comment getAndResetJsDoc() {
416 Comment saved = currentJsDocComment;

Callers 1

peekTokenMethod · 0.95

Calls 4

getTokenLengthMethod · 0.80
setLineColumnNumberMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected