Skip to content
This repository was archived by the owner on Nov 3, 2024. It is now read-only.

The mc language

SnaveSutit edited this page Nov 24, 2020 · 11 revisions

Contexts

  • Folder context refers to where functions and directories can be defined.
  • Function context refers to syntax inside of functions where commands can be written.
  • Macro context refers to the folder context inside of .mcm files
#!foo.mc
# Folder context
dir {
    # Folder context
    function bar {
        # Function context
        say Hello
    }
}
# Folder context
function bas {
    # Function context
    say World!
}

Functions

You can create functions using the function keyword:

function foo {
    say I am called via `function mc_file_name:foo`
}

Functions can only be defined within Folder context

Directories

You can create sub directories using the dir keyword:

dir foo {
    function bar {
        say I am called via `function mc_file_name:foo/bar`
    }
    dir bar {
        function bas {
            say I am called via `function mc_file_name:foo/bar/bas`
        }
    }
}

Directories can only be defined within Folder context

Clone this wiki locally