Skip to content

Latest commit

 

History

History
98 lines (75 loc) · 1.51 KB

File metadata and controls

98 lines (75 loc) · 1.51 KB

MVL

a.k.a Most Valuable Language

Build

git clone https://github.com/mishok2503/MVL.git
cd MVL/
./run.sh <file-name>

Parser output AST to file <file-name>.out in JSON. Lexer output logs to file lexer.log.

Syntax

Functions defenitions
f_name(arg1, arg2) {
    skip?
}
Loops
while [expr] {
    skip?
}
Default operators

|+|, |-|, |^|, |==|, |<=|, |>=|, ||||, |&&|, |*|, |/|, !, -

User operators

base operators: |[ +, -, *, /, ^, !, <, >, =, [<>=/]=]| operator = |(base operators)+|

If
if [expr] {
    skip?
} endif
if [expr] {
    skip?
} else {
    skip?
} endif
Operators overloading
|new operator|: {
    skip?
}
Comments
multistring

open: +_+, close - -_-
example:

+_+ comment here 
  +_+ and here -_- 
still here -_-
singlestring

syntax: O_o example:

O_o comment here O_o and here
not comment

Vim support

Alt text

Install

cd vim_support

Add vimrc file contents into your ~/.vimrc file.

mkdir -p ~/.vim/syntax/
cp mvl.vim ~/.vim/syntax/
cp mvl_keywords.txt ~/.vim/

Now you can see highlighting and use autocomplete, by pressing Ctrl+n, inside our *.mvl files.
There is also automatic addition of brackets, and macroses @m for main function and @f for other functions.
Comment lines: select lines in visual mode (or nothing for one line) and type ,cc for comment and ,cu for uncomment lines.