From e62702efd094487ec0187c984d4e38303112b803 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 28 Feb 2020 11:10:17 -0800 Subject: 6066 - Vim syntax highlighting for Mu files --- archive/1.vm/mu.vim | 2 +- html/apps/ex2.2.mu.html | 2 +- html/apps/ex2.mu.html | 2 +- html/apps/ex3.mu.html | 8 ++++---- html/apps/factorial.mu.html | 30 +++++++++++++++--------------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/archive/1.vm/mu.vim b/archive/1.vm/mu.vim index 32fb55df..81741890 100644 --- a/archive/1.vm/mu.vim +++ b/archive/1.vm/mu.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: mu " Maintainer: Kartik Agaram -" URL: http://github.com/akkartik/mu +" URL: http://github.com/akkartik/mu1 " License: public domain " " Copy this into your ftplugin directory, and add the following to your vimrc diff --git a/html/apps/ex2.2.mu.html b/html/apps/ex2.2.mu.html index 711774a2..4ba854ac 100644 --- a/html/apps/ex2.2.mu.html +++ b/html/apps/ex2.2.mu.html @@ -60,7 +60,7 @@ if ('onhashchange' in window) { 4 5 fn foo -> result/ebx: int { 6 var n: int - 7 copy-to n, 3 + 7 copy-to n, 3 8 increment n 9 result <- copy n 10 } diff --git a/html/apps/ex2.mu.html b/html/apps/ex2.mu.html index 38bb9d76..385dc271 100644 --- a/html/apps/ex2.mu.html +++ b/html/apps/ex2.mu.html @@ -65,7 +65,7 @@ if ('onhashchange' in window) { 8 # 7 9 10 fn main -> result/ebx: int { -11 result <- do-add 3 4 +11 result <- do-add 3 4 12 } 13 14 fn do-add a: int, b: int -> result/ebx: int { diff --git a/html/apps/ex3.mu.html b/html/apps/ex3.mu.html index 5b4a00e3..fed6aa64 100644 --- a/html/apps/ex3.mu.html +++ b/html/apps/ex3.mu.html @@ -56,14 +56,14 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/apps/ex3.mu
  1 fn main -> result/ebx: int {
- 2   result <- copy 0
- 3   var i/eax: int <- copy 1
+ 2   result <- copy 0
+ 3   var i/eax: int <- copy 1
  4   {
  5     compare i, 0xa
- 6     break-if->
+ 6     break-if->
  7     result <- add i
  8     i <- increment
- 9     loop
+ 9     loop
 10   }
 11 }
 
diff --git a/html/apps/factorial.mu.html b/html/apps/factorial.mu.html index 7a5d1583..8c5cd816 100644 --- a/html/apps/factorial.mu.html +++ b/html/apps/factorial.mu.html @@ -64,35 +64,35 @@ if ('onhashchange' in window) { 6 var a/eax: (addr array kernel-string) <- copy args 7 var tmp/ecx: int <- length a 8 $main-body: { - 9 compare tmp, 1 + 9 compare tmp, 1 10 # if (len(args) == 1) factorial(5) 11 { -12 break-if-!= -13 var tmp/eax: int <- factorial 5 +12 break-if-!= +13 var tmp/eax: int <- factorial 5 14 exit-status <- copy tmp -15 break $main-body +15 break $main-body 16 } 17 # if (args[1] == "test") run-tests() -18 var tmp2/ecx: int <- copy 1 # we need this just because we don't yet support `index` on literals; requires some translation-time computation +18 var tmp2/ecx: int <- copy 1 # we need this just because we don't yet support `index` on literals; requires some translation-time computation 19 var tmp3/ecx: (addr kernel-string) <- index a, tmp2 -20 var tmp4/eax: boolean <- kernel-string-equal? *tmp3, "test" -21 compare tmp4, 0 +20 var tmp4/eax: boolean <- kernel-string-equal? *tmp3, "test" +21 compare tmp4, 0 22 { -23 break-if-= +23 break-if-= 24 run-tests -25 exit-status <- copy 0 # TODO: get at Num-test-failures somehow +25 exit-status <- copy 0 # TODO: get at Num-test-failures somehow 26 } 27 } 28 } 29 30 fn factorial n: int -> result/eax: int { -31 compare n 1 +31 compare n 1 32 { -33 break-if-> -34 result <- copy 1 +33 break-if-> +34 result <- copy 1 35 } 36 { -37 break-if-<= +37 break-if-<= 38 var tmp/ecx: int <- copy n 39 tmp <- decrement 40 result <- factorial tmp @@ -101,8 +101,8 @@ if ('onhashchange' in window) { 43 } 44 45 fn test-factorial { -46 var result/eax: int <- factorial 5 -47 check-ints-equal result 0x78 "F - test-factorial" +46 var result/eax: int <- factorial 5 +47 check-ints-equal result 0x78 "F - test-factorial" 48 } -- cgit 1.4.1-2-gfad0