Search in sources :

Example 11 with Comment

use of org.mozilla.javascript.ast.Comment in project HL4A by HL4A.

the class Parser method recordComment.

private void recordComment(int lineno, String comment) {
    if (scannedComments == null) {
        scannedComments = new ArrayList<Comment>();
    }
    Comment commentNode = new Comment(ts.tokenBeg, ts.getTokenLength(), ts.commentType, comment);
    if (ts.commentType == Token.CommentType.JSDOC && compilerEnv.isRecordingLocalJsDocComments()) {
        currentJsDocComment = commentNode;
    }
    commentNode.setLineno(lineno);
    scannedComments.add(commentNode);
}
Also used : Comment(org.mozilla.javascript.ast.Comment)

Aggregations

Comment (org.mozilla.javascript.ast.Comment)11 AstNode (org.mozilla.javascript.ast.AstNode)8 XmlString (org.mozilla.javascript.ast.XmlString)5 ArrayList (java.util.ArrayList)3 Name (org.mozilla.javascript.ast.Name)3 AstRoot (org.mozilla.javascript.ast.AstRoot)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 ParseException (net.sourceforge.pmd.lang.ast.ParseException)1 Assignment (org.mozilla.javascript.ast.Assignment)1 Block (org.mozilla.javascript.ast.Block)1 CatchClause (org.mozilla.javascript.ast.CatchClause)1 DestructuringForm (org.mozilla.javascript.ast.DestructuringForm)1 EmptyExpression (org.mozilla.javascript.ast.EmptyExpression)1 ErrorNode (org.mozilla.javascript.ast.ErrorNode)1 FunctionNode (org.mozilla.javascript.ast.FunctionNode)1 LetNode (org.mozilla.javascript.ast.LetNode)1 ObjectLiteral (org.mozilla.javascript.ast.ObjectLiteral)1