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

Function constructor_annotation

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

Source from the content-addressed store, hash-verified

784}
785
786static bool constructor_annotation(TSLexer *lexer) {
787 advance(lexer); // @
788 bool newline = false;
789 if (!constructor_trivia(lexer, &newline)) return false;
790 if (lexer->lookahead == '[') return constructor_balanced(lexer, ']');
791 for (;;) {
792 if (!constructor_trivia(lexer, &newline)) return false;
793 if (lexer->lookahead == '`') {
794 advance(lexer);
795 while (!lexer->eof(lexer) && lexer->lookahead != '`') advance(lexer);
796 if (lexer->eof(lexer)) return false;
797 advance(lexer);
798 } else {
799 if (!constructor_word_char(lexer->lookahead)) return false;
800 char ignored[32]; constructor_word(lexer, ignored, sizeof(ignored));
801 }
802 if (!constructor_trivia(lexer, &newline)) return false;
803 if (lexer->lookahead == ':') {
804 advance(lexer); // use-site target
805 if (!constructor_trivia(lexer, &newline)) return false;
806 if (lexer->lookahead == '[') return constructor_balanced(lexer, ']');
807 continue;
808 }
809 if (lexer->lookahead == '.') { advance(lexer); continue; }
810 break;
811 }
812 if (!constructor_trivia(lexer, &newline)) return false;
813 if (lexer->lookahead == '<' && !constructor_balanced(lexer, '>')) return false;
814 if (!constructor_trivia(lexer, &newline)) return false;
815 if (lexer->lookahead == '(' && !constructor_balanced(lexer, ')')) return false;
816 return true;
817}
818
819// Advance-only: every caller has already marked the token end.
820static bool where_type_constraint_follows(TSLexer *lexer, bool *newline) {

Callers 3

trailing_lambda_followsFunction · 0.85

Calls 5

constructor_triviaFunction · 0.85
constructor_balancedFunction · 0.85
constructor_word_charFunction · 0.85
constructor_wordFunction · 0.85
advanceFunction · 0.70

Tested by

no test coverage detected