New configs

This commit is contained in:
2024-05-18 23:46:28 +03:00
parent 7f13ec22ea
commit 5a3ae61e8b
11 changed files with 235 additions and 58 deletions

View File

@@ -0,0 +1,38 @@
" Vim syntax file
" Language: MClang
" Maintainer: MCorange
" Maintainer: xomf
if exists("b:current_syntax")
finish
endif
syn keyword MCLangKeywords contained memory fn const in inline include assert with returns typedef structdef if else elif end done then while do
syn keyword MCLangInstructions contained divmod div mod _dbg_print eq lt gt le ge ne shr shl bor band not dup swap drop over rot syscall0 syscall1 syscall2 syscall3 syscall4 syscall5 syscall6
syn keyword MCLangTypes contained void u8 u16 u32 u64 ptr char
syn keyword MCLangBool contained true false
syn keyword MCLangConst contained NULL
" i8 i16 i32 i64 f32 f64
syn match MCLangComment '//.*'
syn match MCLangIdentifier '(?<=^|\\s)([a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+\\([a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+\\)|[a-z|A-Z|_|\\-][0-9|a-z|A-Z|_|\\-]+)(?:\\s|$)'
syn match MCLangNumber '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b(?!\\$)'
syn region MCLangString start='"' end='"' contained
syn region MCLangChar start='\'' end='\'' contained
let b:current_syntax = "MCLang"
hi def link MCLangComment Comment
hi def link MCLangTypes Type
hi def link MCLangString Constant
hi def link MCLangChar Character
hi def link MCLangNumber Constant
hi def link MCLangConst Constant
hi def link MCLangBool Boolean
hi def link MCLangInstructions Operator
hi def link MCLangKeywords Keyword
hi def link MCLangIdentifier Identifier

View File

@@ -0,0 +1,49 @@
include "std.mcl"
structdef Uwu do
owo do u64 end
twt do u64 end
done
structdef Foo do
buz do u64 end
uwu do Uwu end
done
memory s_foo Foo end
//? Comments :3
// extern fn a with void returns void then done
// inline fn b with void returns void then done
// export fn c with void returns void then done
// fn putd with int returns void then drop done
fn main with void returns void then
s_foo.uwu.twt 69 write64
s_foo.uwu.twt read64 _dbg_print
// 1 2 add
// 69 _dbg_print
// "Hewo\n" puts
// if 3 4 eq do
// "omg what impossible!\n"
// else if 1 1 eq do
// "whaaaaaaaaa\n"
// else
// "finally, some good soup\n"
// done
// puts
// 10
// while dup 0 gt do
// "uwu " puts
// dup _dbg_print
// 1 sub
// done
done