-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added Kotin classes and control structures
- Loading branch information
Showing
2 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} | ||
|