Skip to content

Commit

Permalink
added Kotin classes and control structures
Browse files Browse the repository at this point in the history
  • Loading branch information
naeem4633 committed Jul 25, 2024
1 parent 1e4ec1a commit 91a3d80
Show file tree
Hide file tree
Showing 2 changed files with 122 additions and 0 deletions.
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
}
}
}

0 comments on commit 91a3d80

Please sign in to comment.