Syntaxis Basics - IUrixl/Kova GitHub Wiki

Introduction to Kova's syntaxis

Kova has its own syntaxis, its easy and looks clean, heavily inspired by c++ and rust but given its own style.

Labels

Kova's runtime works based on "labels", essentialy the same as batch but the difference is that a main label will always be required and you cannot define them using :label instead you must declare it following its structure.

Structures

Kova's structures are mainly composed by a keyword, a derivator sign and an initialization sign and an ending sign, but dont worry its easier as it seems!

A keyword could be something like "define" for labels, "if" for conditionals, "repeat" for ranged-loops, "case" for single-line conditionals... Then every keyword must be followed by its args and a derivator sign "->" and, depending on the keyword, a "{" to open the structure and "}" to close itself. Take a look at the following example.

define main -> {
    repeat 0 10 -> {
        print "This is a ranged-loop%escEM%"
    }
}

Code comments

You can always comment your kova code by using // at th beginning of a line :).

Limitations and escape symbols

Batch has lots of limitations when reading files such as ignoring or skipping characters that may be considered a "eol" like "!" or ",". To deal with this and be able to use all of batch's utils on kova there's specific variables for each character. They are scaped on each transpiled file at the very beginning before the transpiled-code section is ran.

Symbol Variable Example of use
? escQM print "Yo %escQM%
! escEM print "%escEM%variableName%escEM%
* escST var# math 10 %escST% 2

Note: There's no need to use !variableName! (%escEM%variableName%escEM%) unless you're within a for loop, you can always type print "%variableName%" if youre outside a for loop, just like batch!