MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / constructor_trivia

Function constructor_trivia

codegraph-kernel/grammars/kotlin/scanner.c:653–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

651}
652
653static bool constructor_trivia(TSLexer *lexer, bool *newline) {
654 for (;;) {
655 while (constructor_space(lexer->lookahead)) {
656 if (lexer->lookahead == '\n' || lexer->lookahead == '\r') *newline = true;
657 advance(lexer);
658 }
659 if (lexer->lookahead != '/') return true;
660 advance(lexer);
661 if (lexer->lookahead == '/') {
662 while (!lexer->eof(lexer) && lexer->lookahead != '\n' && lexer->lookahead != '\r') advance(lexer);
663 } else if (lexer->lookahead == '*') {
664 advance(lexer);
665 unsigned depth = 1;
666 while (depth && !lexer->eof(lexer)) {
667 int32_t c = lexer->lookahead;
668 if (c == '\n' || c == '\r') *newline = true;
669 advance(lexer);
670 if (c == '/' && lexer->lookahead == '*') { advance(lexer); depth++; }
671 else if (c == '*' && lexer->lookahead == '/') { advance(lexer); depth--; }
672 }
673 if (depth) return false;
674 } else return false;
675 }
676}
677
678// Read complete identifiers, including non-ASCII continuations. Only an
679// entirely ASCII word can be a modifier/constructor keyword. The generated

Callers 6

constructor_balancedFunction · 0.85
constructor_annotationFunction · 0.85
trailing_lambda_followsFunction · 0.85

Calls 2

constructor_spaceFunction · 0.85
advanceFunction · 0.70

Tested by

no test coverage detected