From 1ae4e0d95f7e37dc7d0b146542fc39b4aed491de Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 12 Jun 2015 22:28:46 -0700 Subject: 1555 - mu.vim: distinguish control-flow from constants We also do this in regular C++ now. --- mu.vim | 12 +++++++----- vimrc.vim | 3 +-- 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 "\" -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 " <- \|\" | 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 "\" + syntax match muAssign " <- \|\" | highlight link muAssign SpecialChar endfunction call HighlightTangledFile() autocmd BufRead,BufNewFile *.mu set ft=mu -- cgit 1.4.1-2-gfad0