diff options
-rw-r--r-- | .idea/vcs.xml | 1 | ||||
-rw-r--r-- | README.md | 35 |
2 files changed, 36 insertions, 0 deletions
diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 4ff0a88..0b934c0 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -1,6 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> <mapping directory="$PROJECT_DIR$/_build" vcs="Git" /> </component> </project>
\ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7714f15 --- /dev/null +++ b/README.md @@ -0,0 +1,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 +```
\ No newline at end of file |