From 8e0f9f265193b711d6f1debf69815b3e08719ddc Mon Sep 17 00:00:00 2001
From: Pocco81
Symbols | Function | Example | - -
// |
-Single-line comment | -- -``` -// hello world! -``` - - | -
/**/ |
-Multi-line comment | -- -``` -/* - This is a multi-line comment and - you are watcing Disney channel! -*/ -``` - - | -
: |
- Set a key, followed by its data type (optional) and then the value. To define a literal key put it between single quotes ('' ) |
-- -``` -hello: "world!" - -// specifying data type -temperature:int 12.23 -``` - - | -
${} |
-Call a variable | -- -``` -// simple usage -name: "Michael Theodor Mouse" -hello: "Good evening ${name}" - -// with arrays (using the `.` notation) -user: { - name: "Michael", - surnames: "Theodor Mouse" -} -hi: "Good morning ${user.name}" -``` - - | -
"" |
-Define a normal string | -- -``` -hello: "world" -``` - - | -
""" """ |
-Define a multi-line string | -- -``` -hello: """My name is - Michael Theodor Mouse, but - you can call me Peter. -""" -``` - - | -
'' |
-Define a literal value | -- -``` -weird_path: 'pc/\fds!fd/\&24324%!@' -``` - - | -
[] |
-Define an array | -- -``` -hosts: [ "omega", "alpha", "gama" ] -``` - - | -
{} |
-Define an object | -- -``` -user: { - name: "Michael Theodor Mouse", - age: 92 -} -``` - - | -
import |
- Import other .koy files |
-- -``` -// single import -import "./directory/settings.koy" - -// multiple imports -import { - "./directory/user0.koy", - "./directory/user1.koy", - "./directory/user2.koy" -} -``` - - | -
<< |
-Overwrite values from objects | -- -``` -user: { - name: "Michael Theodor Mouse", - age: 93 -} - -laptop: { - name: "Lenovo Thinkpad", - owner: ${user} << { - name: "Dominic Toretto" - } -} -``` - - | -
.koy
file using every feature