diff options
-rw-r--r-- | global.mu | 14 | ||||
-rw-r--r-- | mu.vim | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/global.mu b/global.mu new file mode 100644 index 00000000..839926a7 --- /dev/null +++ b/global.mu @@ -0,0 +1,14 @@ +# example program: creating and using global variables + +recipe main [ + # allocate 5 locations for globals + global-space:address:array:location <- new location:type, 5:literal + # read to globals by using /space:global + 1:number/space:global <- copy 3:literal + foo +] + +recipe foo [ + # ditto for writing to globals + $print 1:number/space:global +] diff --git a/mu.vim b/mu.vim index fb8c0b91..c5e7eebb 100644 --- a/mu.vim +++ b/mu.vim @@ -45,10 +45,11 @@ 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 keyword muKeyword default-space global-space next-ingredient ingredient | highlight link muKeyword Constant syntax match muDelimiter "[{}]" | highlight link muDelimiter Delimiter syntax match muAssign " <- \|\<raw\>" | highlight link muAssign SpecialChar +syntax match muGlobal %[^ ]\+:global/\?[^ ,]*% | highlight link muGlobal SpecialChar syntax keyword muControl reply reply-if reply-unless jump jump-if jump-unless loop loop-if loop-unless break 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 |