about summary refs log blame commit diff stats
path: root/linux/braces
blob: 573a66bec991d8381c2c61e5517c46fc1ce17ed2 (plain) (tree)
blob is binary.
com> 2020-02-28 11:19:53 -0800 6067' href='/akkartik/mu/commit/mu.vim?h=main&id=eaeb43de2ebf4979cbb5e5afcb62b410e82715ab'>eaeb43de ^
bfcbdf0e ^

eaeb43de ^
fe6d099b ^



eaeb43de ^















eaeb43de ^
d906d5fd ^
00af72cc ^


eaeb43de ^






8f32cb82 ^

2d4d1440 ^
eaeb43de ^
d23f5ea2 ^

eaeb43de ^





eaeb43de ^



783eb31a ^
eaeb43de ^
783eb31a ^
af983921 ^
783eb31a ^


fe6d099b ^
783eb31a ^

fe6d099b ^
eaeb43de ^

93a4ada6 ^
eaeb43de ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74





                                              

                                                                            
                                                       



                                                                          















                                                                    
                                                                                       
                                                                             


                                                                         






                                                                                    

                                                 
                                
                                 

                                                        





                                   



                                                   
                                
 
                             
                                        


                                               
                                    

                                                
                                

                             
                                                                                        


                              
" Vim syntax file
" Language:    mu
" Maintainer:  Kartik Agaram <mu@akkartik.com>
" URL:         http://github.com/akkartik/mu
" License:     public domain
"
" Copy this file into your ftplugin directory, and add the following to your
" vimrc or to .vim/ftdetect/mu.vim:
"   autocmd BufReadPost,BufNewFile *.mu set filetype=mu
"
" Some highlight groups you might want to select colors for in your vimrc:
"   muFunction
"   muTest

let s:save_cpo = &cpo
set cpo&vim

" todo: why does this periodically lose syntax, like on file reload?
"   $ vim x.mu
"   :e
"? if exists("b:syntax")
"?   finish
"? endif
"? let b:syntax = "mu"

setlocal iskeyword=@,48-57,?,!,_,$,-
setlocal formatoptions-=t  " Mu programs have long lines
setlocal formatoptions+=c  " but comments should still wrap

syntax match muSalientComment /##.*$/  | highlight link muSalientComment SalientComment
syntax match muComment /#\( \.\|? \)\@!.*/ | highlight link muComment Comment
syntax match muS1Comment /# \..*/ | highlight link muS1Comment Comment
syntax match muS2Comment /# \. \..*/ | highlight link muS2Comment Comment

set comments+=n:#
syntax match muCommentedCode "#? .*"  | highlight link muCommentedCode CommentedCode
let b:cmt_head = "#? "

syntax match muDelimiter "[{}]"  | highlight link muDelimiter Delimiter

" Mu literals
syntax match muLiteral %\<-\?[0-9][0-9A-Fa-f]*\>%
syntax match muLiteral %\<-\?0x[0-9A-Fa-f]\+\>%
syntax match muLiteral %"[^"]*"%
highlight link muLiteral Constant
syntax match muError %\<[0-9][0-9A-Fa-f]*[^0-9A-Fa-f]\>%
highlight link muError Error

" sources of action at a distance
syntax match muAssign "<-"
highlight link muAssign SpecialChar

" common keywords
syntax match muControl "^return\>\| return\>"
syntax match muControl "\<jump\>\|\<jump-if[^ ]*"
syntax match muControl "\<break\>\|\<break-if[^ ]*"
syntax match muControl "\<loop\>\|\<loop-if[^ ]*"
highlight link muControl PreProc

syntax match muKeyword " -> "
syntax keyword muKeyword fn sig type var
highlight link muKeyword PreProc

syntax match muFunction "\(fn\s*\)\@<=\(\S\+\)"
highlight link muFunction Identifier

syntax match muTest "\(fn\s*\)\@<=\(test-\S\+\)"
highlight link muTest Identifier

syntax match muData "^type\>"
syntax match muData "\<eax\>\|\<ecx\>\|\<edx\>\|\<ebx\>\|\<esi\>\|\<edi\>\|\<xmm[0-7]\>"
highlight link muData Constant

let &cpo = s:save_cpo