about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-07-19 23:24:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-07-19 23:24:03 -0700
commitde5e1931edbfc265c4a6b0d6f50b73648361fa63 (patch)
tree3eda75a64332959e2f1204e23d69f6a7449a8170
parent1eb1ac81ea0eb5e8b10153a70f4948ac92f1f14d (diff)
downloadmu-de5e1931edbfc265c4a6b0d6f50b73648361fa63.tar.gz
start work on running the Mu toolchain atop Mu
-rw-r--r--linux/apps/ex1.subx2
-rw-r--r--linux/apps/ex10.subx2
-rw-r--r--linux/apps/ex11.subx2
-rw-r--r--linux/apps/ex12.subx2
-rw-r--r--linux/apps/ex13.subx2
-rw-r--r--linux/apps/ex14.subx2
-rw-r--r--linux/apps/ex2.subx2
-rw-r--r--linux/apps/ex3.subx2
-rw-r--r--linux/apps/ex4.subx2
-rw-r--r--linux/apps/ex5.subx2
-rw-r--r--linux/apps/ex6.subx2
-rw-r--r--linux/apps/ex7.subx2
-rw-r--r--linux/apps/ex8.subx2
-rw-r--r--linux/apps/ex9.subx2
14 files changed, 14 insertions, 14 deletions
diff --git a/linux/apps/ex1.subx b/linux/apps/ex1.subx
index 0406dbe8..9661993d 100644
--- a/linux/apps/ex1.subx
+++ b/linux/apps/ex1.subx
@@ -4,7 +4,7 @@
 # Same as https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex1.subx -o ex1
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex1.subx -o ex1
 #   $ bootstrap/bootstrap run ex1
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex10.subx b/linux/apps/ex10.subx
index c4ce7e2d..71fa4c0e 100644
--- a/linux/apps/ex10.subx
+++ b/linux/apps/ex10.subx
@@ -1,7 +1,7 @@
 # String comparison: return 1 iff the two args passed in at the commandline are equal.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex10.subx -o ex10
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex10.subx -o ex10
 #   $ bootstrap/bootstrap run ex10 abc abd
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex11.subx b/linux/apps/ex11.subx
index 0ec5cc1a..dd16267d 100644
--- a/linux/apps/ex11.subx
+++ b/linux/apps/ex11.subx
@@ -6,7 +6,7 @@
 # a null-terminated 'kernel string' with a size-prefixed 'SubX string'.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex11.subx -o ex11
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex11.subx -o ex11
 #   $ bootstrap/bootstrap run ex11  # runs a series of tests
 #   ......  # all tests pass
 #
diff --git a/linux/apps/ex12.subx b/linux/apps/ex12.subx
index 476d8cda..b9708324 100644
--- a/linux/apps/ex12.subx
+++ b/linux/apps/ex12.subx
@@ -2,7 +2,7 @@
 # Create a new segment using mmap, save the address, write to it.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex12.subx -o ex12
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex12.subx -o ex12
 #   $ bootstrap/bootstrap run ex12
 # You shouldn't get a segmentation fault.
 
diff --git a/linux/apps/ex13.subx b/linux/apps/ex13.subx
index 56028a05..28ab4694 100644
--- a/linux/apps/ex13.subx
+++ b/linux/apps/ex13.subx
@@ -1,7 +1,7 @@
 # Compare 3 and 3.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex13.subx -o ex13
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex13.subx -o ex13
 #   $ bootstrap/bootstrap run ex13
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex14.subx b/linux/apps/ex14.subx
index 70aa8629..b6be70d7 100644
--- a/linux/apps/ex14.subx
+++ b/linux/apps/ex14.subx
@@ -1,7 +1,7 @@
 # Multiply 2 numbers.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex14.subx -o ex14
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex14.subx -o ex14
 #   $ bootstrap/bootstrap run ex14
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex2.subx b/linux/apps/ex2.subx
index 40955104..342ec6c6 100644
--- a/linux/apps/ex2.subx
+++ b/linux/apps/ex2.subx
@@ -1,7 +1,7 @@
 # Add 3 and 4, and return the result in the exit code.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex2.subx -o ex2
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex2.subx -o ex2
 #   $ bootstrap/bootstrap run ex2
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex3.subx b/linux/apps/ex3.subx
index f4b5fed7..6e1b71ef 100644
--- a/linux/apps/ex3.subx
+++ b/linux/apps/ex3.subx
@@ -1,7 +1,7 @@
 # Add the first 10 numbers, and return the result in the exit code.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex3.subx -o ex3
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex3.subx -o ex3
 #   $ bootstrap/bootstrap run ex3
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex4.subx b/linux/apps/ex4.subx
index 3bf62551..59bf0649 100644
--- a/linux/apps/ex4.subx
+++ b/linux/apps/ex4.subx
@@ -1,7 +1,7 @@
 # Read a character from stdin, save it to a global, write it to stdout.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex4.subx -o ex4
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex4.subx -o ex4
 #   $ bootstrap/bootstrap run ex4
 
 == data
diff --git a/linux/apps/ex5.subx b/linux/apps/ex5.subx
index 220a4246..ec68b855 100644
--- a/linux/apps/ex5.subx
+++ b/linux/apps/ex5.subx
@@ -1,7 +1,7 @@
 # Read a character from stdin, save it to a local on the stack, write it to stdout.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex5.subx -o ex5
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex5.subx -o ex5
 #   $ bootstrap/bootstrap run ex5
 
 == code
diff --git a/linux/apps/ex6.subx b/linux/apps/ex6.subx
index cf6309e6..d4e7a656 100644
--- a/linux/apps/ex6.subx
+++ b/linux/apps/ex6.subx
@@ -1,7 +1,7 @@
 # Print out a (global variable) string to stdout.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex6.subx -o ex6
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex6.subx -o ex6
 #   $ bootstrap/bootstrap run ex6
 #   Hello, world!
 
diff --git a/linux/apps/ex7.subx b/linux/apps/ex7.subx
index c14fc19d..99f01e0d 100644
--- a/linux/apps/ex7.subx
+++ b/linux/apps/ex7.subx
@@ -5,7 +5,7 @@
 # the character read.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex7.subx -o ex7
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex7.subx -o ex7
 #   $ bootstrap/bootstrap run ex7
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex8.subx b/linux/apps/ex8.subx
index 2d962be4..318f6dee 100644
--- a/linux/apps/ex8.subx
+++ b/linux/apps/ex8.subx
@@ -1,7 +1,7 @@
 # Example reading commandline arguments: compute length of first arg.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex8.subx -o ex8
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex8.subx -o ex8
 #   $ bootstrap/bootstrap run ex8 abc de fghi
 # Expected result:
 #   $ echo $?
diff --git a/linux/apps/ex9.subx b/linux/apps/ex9.subx
index 27520191..e1d2bf74 100644
--- a/linux/apps/ex9.subx
+++ b/linux/apps/ex9.subx
@@ -4,7 +4,7 @@
 # letter of second arg.
 #
 # To run:
-#   $ bootstrap/bootstrap translate apps/ex9.subx -o ex9
+#   $ bootstrap/bootstrap translate 000init.subx apps/ex9.subx -o ex9
 #   $ bootstrap/bootstrap run ex9 z x
 # Expected result:
 #   $ echo $?
&id=372367f59a897162912d0646158bdea1e07d6e66'>372367f5 ^
9d1f0e6e ^
eaeb43de ^
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





                                              

                                                                            
                                                       

                                                                          



                                     















                                                                    
                                                                                       
                                                                             


                                                                         






                                                                                    

                                                 
                                
                                 

                                                        



                                   
                                          
                               

                 
                                                       


                                                   
                                
 
                             
                                        

                                
                                                
                                    
 
                                                 
                                

                             
                                  

                              


                                                                                    
                               
                             
                               
                              
                               
                             
                               
                             
                               
                             
 
                     
" Vim syntax file
" Language:    mu
" Maintainer:  Kartik Agaram <mu@akkartik.com>
" URL:         http://github.com/akkartik/mu
" License:     public domain
"
" Copy this file into your ftplugin directory, and add the following to your
" vimrc or to .vim/ftdetect/mu.vim:
"   autocmd BufReadPost,BufNewFile *.mu set filetype=mu
"
" Some highlight groups you might want to select colors for in your vimrc:
highlight link CommentedCode Comment
highlight link SalientComment Comment
highlight link muFunction Identifier
highlight link muTest Identifier

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 muSalientComment /##.*$/  | highlight link muSalientComment SalientComment
syntax match muComment /#\( \.\|? \)\@!.*/ | highlight link muComment Comment
syntax match muS1Comment /# \..*/ | highlight link muS1Comment Comment
syntax match muS2Comment /# \. \..*/ | highlight link muS2Comment Comment

set comments+=n:#
syntax match muCommentedCode "#? .*"  | highlight link muCommentedCode CommentedCode
let b:cmt_head = "#? "

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

" Mu literals
syntax match muLiteral %\<-\?[0-9][0-9A-Fa-f]*\>%
syntax match muLiteral %\<-\?0x[0-9A-Fa-f]\+\>%
syntax match muLiteral %"[^"]*"%
highlight link muLiteral Constant
syntax match muError %\<[0-9][0-9A-Fa-f]*[^0-9A-Fa-f]\>%
highlight link muError Error

" sources of action at a distance
syntax match muAssign "<-"
highlight link muAssign SpecialChar
syntax keyword muAssign error error-stream
highlight link muAssign Special

" common keywords
syntax match muControl "\<return\>\|\<return-if[^ ]*\>"
syntax match muControl "\<jump\>\|\<jump-if[^ ]*"
syntax match muControl "\<break\>\|\<break-if[^ ]*"
syntax match muControl "\<loop\>\|\<loop-if[^ ]*"
highlight link muControl PreProc

syntax match muKeyword " -> "
syntax keyword muKeyword fn sig type var
highlight link muKeyword PreProc

syntax match muFunction "\(fn\s\+\)\@<=\(\S\+\)"
highlight link muFunction Identifier

syntax match muTest "\(fn\s\+\)\@<=\(test-\S\+\)"
highlight link muTest Identifier

syntax match muData "^type\>"
syntax match muData "\<xmm[0-7]\>"
highlight link muData Constant

" Some hacky colors for a light background.
" TODO: They should really be theme-dependent. Use tools/regs.mu when tweaking them.
" eax is so common that it's not worth highlighting
syntax match muRegEcx "\<ecx\>"
highlight muRegEcx ctermfg=88
syntax match muRegEdx "\<edx\>"
highlight muRegEdx ctermfg=130
syntax match muRegEbx "\<ebx\>"
highlight muRegEbx ctermfg=57
syntax match muRegEsi "\<esi\>"
highlight muRegEsi ctermfg=25
syntax match muRegEdi "\<edi\>"
highlight muRegEdi ctermfg=34

let &cpo = s:save_cpo