difftastic/vendor/tree-sitter-kotlin/test/corpus/source-files.txt

112 lines
2.1 KiB
Plaintext

==================
File annotations
==================
@file:JvmName("HelloWorld")
val x = 4
---
(source_file
(file_annotation
(constructor_invocation
(user_type (type_identifier))
(value_arguments (value_argument (line_string_literal)))))
(property_declaration
(variable_declaration
(simple_identifier))
(integer_literal)))
===================
Multiple file annotations
===================
@file:JvmMultifileClass
@file:JvmName("BuildersKt")
@file:OptIn(ExperimentalContracts::class)
---
(source_file
(file_annotation
(user_type
(type_identifier)))
(file_annotation
(constructor_invocation
(user_type
(type_identifier))
(value_arguments
(value_argument
(line_string_literal)))))
(file_annotation
(constructor_invocation
(user_type
(type_identifier))
(value_arguments
(value_argument
(callable_reference
(type_identifier)))))))
==================
Imports
==================
import java.util.Scanner
import java.util.StringBuilder
import java.io.Path
import java.io.Files
fun main() {
}
---
(source_file
(import_list
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier)))
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier))))
(import_list
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier)))
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier))))
(function_declaration
(simple_identifier)
(function_body)))
===================
Multiple Imports On A Single Line
===================
import java.io.Path import java.io.Files
---
(source_file
(import_list
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier)))
(import_header
(identifier
(simple_identifier)
(simple_identifier)
(simple_identifier)))))