robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
aa5819f5a5
master
1" Vim indent plugin file 2" Language: Odin 3" Maintainer: Maxim Kim <habamax@gmail.com> 4" Website: https://github.com/habamax/vim-odin 5" Last Change: 2024-01-15 6" 7" This file has been manually translated from Vim9 script. 8 9if exists ( "b:current_syntax" ) 10finish 11endif 12 13let s: cpo_save = & cpo 14set cpo & vim 15 16syntax keyword odinKeyword using transmute cast distinct opaque where dynamic 17syntax keyword odinKeyword struct enum union const bit_field bit_set 18syntax keyword odinKeyword package proc map import export foreign 19syntax keyword odinKeyword size_of offset_of type_info_of typeid_of type_of align_of 20syntax keyword odinKeyword return defer 21syntax keyword odinKeyword or_return or_else 22syntax keyword odinKeyword inline no_inline 23 24syntax keyword odinConditional if when else do for switch case continue break 25syntax keyword odinType string cstring bool b8 b16 b32 b64 rune any rawptr 26syntax keyword odinType f16 f32 f64 f16le f16be f32le f32be f64le f64be 27syntax keyword odinType u8 u16 u32 u64 u128 u16le u32le u64le u128le u16be 28syntax keyword odinType u32be u64be u128be uint uintptr i8 i16 i32 i64 i128 29syntax keyword odinType i16le i32le i64le i128le i16be i32be i64be i128be 30syntax keyword odinType int complex complex32 complex64 complex128 matrix typeid 31syntax keyword odinType quaternion quaternion64 quaternion128 quaternion256 32syntax keyword odinBool true false 33syntax keyword odinNull nil 34syntax match odinUninitialized '\s\+---\(\s\|$\) ' 35 36syntax keyword odinOperator in notin not_in 37syntax match odinOperator "? "display 38syntax match odinOperator "-> "display 39 40syntax match odinTodo "TODO "contained 41syntax match odinTodo "XXX "contained 42syntax match odinTodo "FIXME "contained 43syntax match odinTodo "HACK "contained 44 45syntax region odinRawString start = +` +end = +` + 46syntax region odinChar start = +' +skip = +\\\\\|\\' +end = +' + 47syntax region odinString start = +" +skip = +\\\\\|\\' +end = +" +contains = odinEscape 48syntax match odinEscape display contained /\\\( [ nrt\\'" ] \|x\x\{2}\) / 49 50syntax match odinProcedure "\v<\w * >(\s * ::\s * proc)@= " 51 52syntax match odinAttribute "@\ze\<\w\+\> "display 53syntax region odinAttribute 54 \matchgroup = odinAttribute 55 \start = "@\ze( "end = "\ze) " 56 \transparent oneline 57 58syntax match odinInteger "\-\?\<\d\+\> "display 59syntax match odinFloat "\-\?\< [ 0-9 ][ 0-9_ ] * \%(\. [ 0-9 ][ 0-9_ ] * \)\%( [ eE ][ +- ] \= [ 0-9_ ] \+\)\= "display 60syntax match odinHex "\<0 [ xX ][ 0-9A-Fa-f ] \+\> "display 61syntax match odinDoz "\<0 [ zZ ][ 0-9a-bA-B ] \+\> "display 62syntax match odinOct "\<0 [ oO ][ 0-7 ] \+\> "display 63syntax match odinBin "\<0 [ bB ][ 01 ] \+\> "display 64 65syntax match odinAddressOf "& "display 66syntax match odinDeref "\^ "display 67 68syntax match odinMacro "#\<\w\+\> "display 69 70syntax match odinTemplate "$\<\w\+\> " 71 72syntax region odinLineComment start = /\/\/ /end = /$ /contains = @Spell , odinTodo 73syntax region odinBlockComment start = /\/\* /end = /\*\/ /contains = @Spell , odinTodo , odinBlockComment 74syn sync ccommentodinBlockComment 75 76highlight def link odinKeyword Statement 77highlight def link odinConditional Conditional 78highlight def link odinOperator Operator 79 80highlight def link odinString String 81highlight def link odinRawString String 82highlight def link odinChar Character 83highlight def link odinEscape Special 84 85highlight def link odinProcedure Function 86 87highlight def link odinMacro PreProc 88 89highlight def link odinLineComment Comment 90highlight def link odinBlockComment Comment 91 92highlight def link odinTodo Todo 93 94highlight def link odinAttribute Statement 95highlight def link odinType Type 96highlight def link odinBool Boolean 97highlight def link odinNull Constant 98highlight def link odinUninitialized Constant 99highlight def link odinInteger Number 100highlight def link odinFloat Float 101highlight def link odinHex Number 102highlight def link odinOct Number 103highlight def link odinBin Number 104highlight def link odinDoz Number 105 106let b: current_syntax = "odin" 107 108let & cpo = s: cpo_save 109unlet s: cpo_save