mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
* Add Ballerina language * Add missing file * Update color * Update with required changes * Update sub-module
32 lines
654 B
Ballerina
32 lines
654 B
Ballerina
import ballerina.lang.system;
|
|
|
|
function main (string[] args) {
|
|
// JSON string value.
|
|
json j1 = "Apple";
|
|
system:println(j1);
|
|
|
|
// JSON number value.
|
|
json j2 = 5.36;
|
|
system:println(j2);
|
|
|
|
// JSON true value.
|
|
json j3 = true;
|
|
system:println(j3);
|
|
|
|
// JSON false value.
|
|
json j4 = false;
|
|
system:println(j4);
|
|
|
|
// JSON null value.
|
|
json j5 = null;
|
|
|
|
//JSON Objects.
|
|
json j6 = {name:"apple", color:"red", price:j2};
|
|
system:println(j6);
|
|
|
|
//JSON Arrays. They are arrays of any JSON value.
|
|
json j7 = [1, false, null, "foo",
|
|
{first:"John", last:"Pala"}];
|
|
system:println(j7);
|
|
}
|