about summary refs log tree commit diff stats
path: root/js/magic-bird/mm.html
Commit message (Expand)AuthorAgeFilesLines
* *elioat2024-01-151-0/+23
t; 2015-09-06 16:32:41 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-09-06 16:32:41 -0700 2174' href='/akkartik/mu/commit/mu.vim?h=main&id=3cf4cc43f2622816777c22c49c32e5159574a1d3'>3cf4cc43 ^
2d4c3296 ^
b38d7fff ^



7fefb8fd ^






b38d7fff ^

9a81d746 ^
0a6d127d ^
b38d7fff ^
b085378e ^



c517316b ^
b085378e ^
c517316b ^
b38d7fff ^
b085378e ^
e82dc626 ^
9a81d746 ^
a6d9bd9b ^
af7349d5 ^
a6d9bd9b ^
e3894819 ^
b38d7fff ^
9a81d746 ^
a6d9bd9b ^


9a81d746 ^
3e1349d2 ^
3e1349d2 ^
f918675c ^
650a201d ^
af7349d5 ^
3e1349d2 ^
af7349d5 ^
3e1349d2 ^


dd660682 ^
01ce563d ^
fbf0536d ^
b38d7fff ^
e82dc626 ^
f918675c ^


b085378e ^
e82dc626 ^
38f0b91a ^
f0c55e6b ^
e82dc626 ^
f0c55e6b ^


e82dc626 ^



f0c55e6b ^





e82dc626 ^

458ee5e3 ^
e82dc626 ^
f0c55e6b ^

816ffe20 ^
458ee5e3 ^
f0c55e6b ^
458ee5e3 ^
b085378e ^
f0c55e6b ^

458ee5e3 ^
b38d7fff ^

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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98





                                              

                                                                             
                                                       



                     






                                                                    

                                    
                                                        
                                                           
 



                                                                                       
                 
                                                                                    
                      
 
                                                                       
 
                                                           
                                                     
                                                                                                            
                                               
                            
                              
                                                    


                                               
             
                                                                
                                                 
                                                                   
                                                            
        
                                                            
                     


                                                                
                                                                                                                           
                                           
                                 
 
                                 


                                   
                                                                                     
 
                 
                                                                  
                                                  


                                                                            



                                                       





                                                                                      

                                                                                   
                                   
 

                                                                    
                                                
                               
 
                                                                            
                                                                                                 

                                           
                              

                     
" Vim syntax file
" Language:    mu
" Maintainer:  Kartik Agaram <mu@akkartik.com>
" URL:         http://github.com/akkartik/mu
" License:     public domain
"
" Copy this into your ftplugin directory, and add the following to your vimrc
" or to .vim/ftdetect/mu.vim:
"   autocmd BufReadPost,BufNewFile *.mu set filetype=mu

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 muComment /#.*$/  | highlight link muComment Comment
syntax match muSalientComment /##.*$/  | highlight link muSalientComment SalientComment
syntax match muComment /;.*$/  | highlight link muComment Comment
syntax match muSalientComment /;;.*$/  | highlight link muSalientComment SalientComment
set comments+=n:#
syntax match muCommentedCode "#? .*"  | highlight link muCommentedCode CommentedCode
let b:cmt_head = "#? "

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

" Mu strings are inside [ ... ] and can span multiple lines
" don't match '[' at end of line, that's usually code
syntax match muLiteral %^[^ a-zA-Z0-9(){}\[\]#$_*@&,=-][^ ,]*\|[ ,]\@<=[^ a-zA-Z0-9(){}\[\]#$_*@&,=-][^ ,]*%
syntax region muString start=+\[[^\]]+ end=+\]+
syntax match muString "\[\]"
highlight link muString String
" Mu syntax for representing the screen in scenarios
syntax region muScreen start=+ \.+ end=+\.$\|$+
highlight link muScreen muString

" Mu literals
syntax match muLiteral %[^ ]\+:literal/[^ ,]*\|[^ ]\+:literal\>%
syntax match muLiteral %\<[0-9-]\?[0-9]\+/[^ ,]*%
syntax match muLiteral % [0-9-]\?[0-9]\+[, ]\@=\| [0-9-]\?[0-9]\+$%
syntax match muLiteral "^\s\+[^ 0-9a-zA-Z{}$#\[\]][^ ]*\s*$"
" labels
syntax match muLiteral %[^ ]\+:label/[^ ,]*\|[^ ]\+:label\>%
" other literal types
syntax match muLiteral %[^ ]\+:type/[^ ,]*\|[^ ]\+:type\>%
syntax match muLiteral %[^ ]\+:offset/[^ ,]*\|[^ ]\+:offset\>%
syntax match muLiteral %[^ ]\+:variant/[^ ,]*\|[^ ]\+:variant\>%
syntax match muLiteral % true\(\/[^ ]*\)\?\| false\(\/[^ ]*\)\?%  " literals will never be the first word in an instruction
syntax match muLiteral % null\(\/[^ ]*\)\?%
highlight link muLiteral Constant

" sources of action at a distance
syntax match muAssign "<-"
syntax match muAssign "\<raw\>"
highlight link muAssign SpecialChar
syntax match muGlobal %[^ ]\+:global/\?[^ ,]*%  | highlight link muGlobal SpecialChar

" common keywords
" use regular expressions for common words that may come after '/'
syntax keyword muKeyword default-space local-scope
syntax keyword muKeyword next-input rewind-inputs load-inputs
syntax keyword muKeyword next-ingredient rewind-ingredients load-ingredients
syntax match muKeyword " input\>\| ingredient\>"
highlight link muKeyword Constant

syntax keyword muControl return return-if return-unless
syntax keyword muControl reply reply-if reply-unless
syntax keyword muControl output-if output-unless
syntax match muControl "^return\>\| return\>\|^reply\>\| reply\>\|^output\|^ output\>"
syntax keyword muControl jump-if jump-unless
syntax keyword muControl break-if break-unless
syntax keyword muControl loop-if loop-unless
syntax match muControl "^jump\>\| jump\>\|^break\>\| break\>\|^loop\>\| loop\>"
syntax keyword muControl start-running
syntax keyword muControl call-with-continuation-mark return-continuation-until-mark
highlight link muControl Identifier

syntax match muRecipe "->"
syntax match muRecipe "^recipe\>\|^def\>\|^before\>\|^after\>\| -> "
syntax keyword muRecipe recipe! def! function fn
highlight link muRecipe PreProc

syntax match muScenario "^scenario\>"  | highlight link muScenario Statement
syntax keyword muPendingScenario pending-scenario  | highlight link muPendingScenario SpecialChar
syntax match muData "^type\>\|^container\>"
syntax keyword muData exclusive-container
highlight link muData Constant

let &cpo = s:save_cpo