about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-12 22:28:46 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-12 22:32:28 -0700
commit1ae4e0d95f7e37dc7d0b146542fc39b4aed491de (patch)
tree9d55bc2c172e57b980a7003d58aa84b453d83016
parent8a8911703fdbdd132f6b64b12ccb834a624bb22f (diff)
downloadmu-1ae4e0d95f7e37dc7d0b146542fc39b4aed491de.tar.gz
1555 - mu.vim: distinguish control-flow from constants
We also do this in regular C++ now.
-rw-r--r--mu.vim12
-rw-r--r--vimrc.vim3
2 files changed, 8 insertions, 7 deletions
diff --git a/mu.vim b/mu.vim
index a90e2bec..2a033b35 100644
--- a/mu.vim
+++ b/mu.vim
@@ -39,15 +39,17 @@ highlight link muString String
 syntax region muScreen start=+ \.+ end=+\.$\|$+
 highlight link muScreen muString
 
-" all mu literals are constants
+" mu literals
 syntax match muNumber %[^ ]\+:literal/\?[^ ,]*%
 highlight link muNumber Constant
+syntax match muLabel "^\s\+[^ 0-9a-zA-Z{}\[\]][^ ]*\s*$"
+syntax match muLabel %[^ ]\+:label/\?[^ ,]*%
+highlight link muLabel Constant
+syntax keyword muKeyword default-space next-ingredient ingredient | highlight link muKeyword Constant
 
 syntax match muDelimiter "[{}]" | highlight link muDelimiter Delimiter
-syntax match muLabel " [^a-zA-Z0-9 \[\.][a-zA-Z0-9-]\+" | highlight link muLabel Function
-syntax match muAssign " <- " | highlight link muAssign SpecialChar
-syntax match muAssign "\<raw\>"
-syntax keyword muControl reply reply-if reply-unless jump jump-if jump-unless loop loop-if loop-unless break-if break-unless default-space next-ingredient ingredient current-continuation continue-from create-delimited-continuation reply-delimited-continuation | highlight link muControl Function
+syntax match muAssign " <- \|\<raw\>" | highlight link muAssign SpecialChar
+syntax keyword muControl reply reply-if reply-unless jump jump-if jump-unless loop loop-if loop-unless break-if break-unless current-continuation continue-from create-delimited-continuation reply-delimited-continuation | highlight muControl ctermfg=3
 " common keywords
 syntax keyword muRecipe recipe before after | highlight muRecipe ctermfg=208
 syntax keyword muScenario scenario | highlight muScenario ctermfg=34
diff --git a/vimrc.vim b/vimrc.vim
index 34fbbb9d..a3f31d1e 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -24,8 +24,7 @@ function! HighlightTangledFile()
   syntax match muCommentedCode /#? .*$/ | highlight link muCommentedCode CommentedCode
   set comments+=n:#
   " Some other bare-bones mu highlighting.
-  syntax match muAssign " <- " | highlight link muAssign SpecialChar
-  syntax match muAssign "\<raw\>"
+  syntax match muAssign " <- \|\<raw\>" | highlight link muAssign SpecialChar
 endfunction
 call HighlightTangledFile()
 autocmd BufRead,BufNewFile *.mu set ft=mu