
After go1.16, go will use module mode by default, even when the repository is checked out under GOPATH or in a one-off directory. Add go.mod, go.sum to keep this repo buildable without opting out of the module mode. > go mod init github.com/mmcgrana/gobyexample > go mod tidy > go mod vendor In module mode, the 'vendor' directory is special and its contents will be actively maintained by the go command. pygments aren't the dependency the go will know about, so it will delete the contents from vendor directory. Move it to `third_party` directory now. And, vendor the blackfriday package. Note: the tutorial contents are not affected by the change in go1.16 because all the examples in this tutorial ask users to run the go command with the explicit list of files to be compiled (e.g. `go run hello-world.go` or `go build command-line-arguments.go`). When the source list is provided, the go command does not have to compute the build list and whether it's running in GOPATH mode or module mode becomes irrelevant.
58 lines
915 B
Plaintext
58 lines
915 B
Plaintext
type tiny = "%i8";
|
|
type int = "%i32";
|
|
typedef bool = 2;
|
|
fun add : int*int -> int = "%add";
|
|
fun sub : int*int -> int = "%sub";
|
|
fun eq : int*int -> bool = "%eq";
|
|
fun lnot : bool -> bool = "%lnot";
|
|
proc exit : int = "exit";
|
|
|
|
// comment 1
|
|
/*
|
|
/*
|
|
foo bar
|
|
*/
|
|
asdas
|
|
*/
|
|
|
|
noinline fun foo (x:int) = {
|
|
val y = 6;
|
|
return x + y;
|
|
}
|
|
|
|
noinline proc fake_exit (x:int) {
|
|
exit x;
|
|
return;
|
|
}
|
|
|
|
noinline fun bar (x:int) = {
|
|
var y = 10;
|
|
noinline proc baz () {
|
|
y = 20;
|
|
return;
|
|
}
|
|
baz ();
|
|
return x + y;
|
|
}
|
|
|
|
noinline fun x (a:int, b:int, c:tiny) = {
|
|
val x1 = a;
|
|
val x2 = b;
|
|
val x3 = c;
|
|
noinline fun y (d:int, e:int, f:tiny) = {
|
|
val y1 = x1;
|
|
val y2 = x2;
|
|
val y3 = f;
|
|
noinline fun z (g:int, h:int, i:tiny) = {
|
|
val z1 = x1;
|
|
val z2 = x2;
|
|
val z3 = i;
|
|
return z1;
|
|
}
|
|
return z (y1,y2,y3);
|
|
}
|
|
return y (x1,x2,x3);
|
|
}
|
|
|
|
fake_exit $ (foo 2) + (bar 3) + (x (1,2,3t));
|