aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 7714f15303d6ba99d6ef4752c459b08bbba59d3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Mint

## Usage
To compile a single Mint file (`.mt`), run the following command:
```shell
node ./_mint/index.js /path/to/the/mint/file
```

The compiled Mint file is placed in `/_build`. If your file was named `something.mt`, the compiled file will be placed in `_build/something.js`.

## Example program
```mint
@mint.lang.StdIO;

global version = "1.1"; // Global variables
const amigood = true;   // Local constants

fn test() { // Functions
    if (version == "1.1") { // Conditions can be in parenthesis...
        if version != "1.0" { // ... or not
            yeet mint.lang.SomethingException("woopsies");
            // Throw an error (SomethingException if it exists, else just InternalExeption)
        }
    }
    if version == "1.0" {
        StdIO.stdout.writeln("hello world, this is version fn ${version}"); // Display text (with variables)
        StdIO.stdout.writeln("you gotta yeet at something");
    } else {
        yeet mint.lang.OutOfBoundsException("woopsies");
        // Throw an error (OutOfBoundsException)
    }
}

test(); // Call the defined function
```