File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * Provides additional AST-like classes outside the generated tree-sitter classes.
3+ */
4+
5+ private import unified
6+
7+ module Public {
8+ /**
9+ * A comment appearing in the source code.
10+ */
11+ class Comment extends TriviaToken {
12+ // At the moment, comments are the only type trivia token we extract
13+ /**
14+ * Gets the text inside this comment, not counting the delimeters.
15+ */
16+ string getCommentText ( ) {
17+ result = this .getValue ( ) .regexpCapture ( "//(.*)" , 1 )
18+ or
19+ result = this .getValue ( ) .regexpCapture ( "(?s)/\\*(.*)\\*/" , 1 )
20+ }
21+ }
22+ }
Original file line number Diff line number Diff line change 55import codeql.Locations
66import codeql.files.FileSystem
77import codeql.unified.Ast:: Unified
8- import codeql.unified.Comments
8+ import codeql.unified.internal.AstExtra :: Public
You can’t perform that action at this time.
0 commit comments