Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Kotlin data types and control structures #732

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions web/thesauruses/kotlin/1.5/control_structures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"meta": {
"language": "kotlin",
"language_name": "Kotlin",
"structure": "control_structures",
"language_version": "1.5"
},
"concepts": {
"if_conditional": {
"name": "If conditional",
"code": "if (condition) {\n // statements\n}"
},
"if_else_conditional": {
"name": "If/Else conditional",
"code": "if (condition) {\n // statements\n} else {\n // statements\n}"
},
"if_elseif_conditional": {
"name": "If/ElseIf conditional",
"code": "if (condition) {\n // statements\n} else if (condition) {\n // statements\n}"
},
"if_elseif_else_conditional": {
"name": "If/ElseIf/Else conditional",
"code": "if (condition) {\n // statements\n} else if (condition) {\n // statements\n} else {\n // statements\n}"
},
"ternary_conditional": {
"name": "Ternary conditional",
"code": "val result = if (condition) valueIfTrue else valueIfFalse"
},
"switch_statement": {
"name": "Switch statement",
"code": "when (expression) {\n value1 -> {\n // statements\n }\n value2 -> {\n // statements\n }\n else -> {\n // statements\n }\n}"
},
"while_loop": {
"name": "While loop",
"code": "while (condition) {\n // statements\n}"
},
"do_while_loop": {
"name": "Do/While loop",
"code": "do {\n // statements\n} while (condition)"
},
"for_loop": {
"name": "For loop",
"code": "for (item in collection) {\n // statements\n}"
},
"foreach_loop": {
"name": "Foreach loop",
"code": "collection.forEach { item ->\n // statements\n}"
}
}
}

71 changes: 71 additions & 0 deletions web/thesauruses/kotlin/1.5/data_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"meta": {
"language": "kotlin",
"language_name": "Kotlin",
"structure": "data_types",
"language_version": "1.5"
},
"concepts": {
"boolean": {
"name": "Boolean",
"code": "Boolean"
},
"signed_integer_8_bit": {
"name": "Signed 8-bit integer",
"code": "Byte"
},
"signed_integer_16_bit": {
"name": "Signed 16-bit integer",
"code": "Short"
},
"signed_integer_32_bit": {
"name": "Signed 32-bit integer",
"code": "Int"
},
"signed_integer_64_bit": {
"name": "Signed 64-bit integer",
"code": "Long"
},
"signed_integer_as_object": {
"name": "Signed object-based Integer",
"code": "Int"
},
"signed_float_16_bit": {
"name": "Signed 16-bit floating point",
"not-implemented": true
},
"signed_float_32_bit": {
"name": "Signed 32-bit floating point",
"code": "Float"
},
"signed_float_64_bit": {
"name": "Signed 64-bit floating point",
"code": "Double"
},
"signed_float_as_object": {
"name": "Signed object-based floating point",
"code": "Float"
},
"string_as_object": {
"name": "String as an object",
"code": "String"
},
"string_as_array": {
"name": "String as an array of characters",
"code": "CharArray"
},
"complex_as_object": {
"name": "Complex Number as an object",
"not-implemented": true
},
"real_number_part": {
"name": "Complex number real part",
"not-implemented": true
},
"imaginary_number_part": {
"name": "Complex number imaginary part",
"not-implemented": true
}
}
}

Loading