This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- rust -*- | |
fn f[T](T x) -> tup(T) { | |
ret tup(x); | |
} | |
fn main() -> () { | |
f("foo"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: local/lib/Object/MachOObjectFile.cpp | |
=================================================================== | |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 | |
+++ local/lib/Object/MachOObjectFile.cpp 2011-03-14 18:00:13.000000000 -0700 | |
@@ -0,0 +1,330 @@ | |
+//===- MachOObjectFile.cpp - Mach-O object file binding ---------*- C++ -*-===// | |
+// | |
+// The LLVM Compiler Infrastructure | |
+// | |
+// This file is distributed under the University of Illinois Open Source |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# More "JavaScript-y" API to WebGL shaders. | |
class Shader | |
constructor: () -> | |
throw new Error "Shader is abstract, use VertexShader or FragmentShader instead" | |
compile: () -> @gl.compileShader @shader | |
del: () -> @gl.deleteShader @shader | |
# Generates a property descriptor that defines a getter for a shader parameter. | |
shaderParameter = (pname) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FRAGMENT_SHADER = ''' | |
precision highp float; | |
void main() { | |
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0); | |
} | |
''' | |
VERTEX_SHADER = ''' | |
attribute vec3 aVertexPosition; | |
uniform mat4 uMVMatrix; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math::sum; | |
fn is_empty<T>(v : &[const T]) -> bool { v.len() > 0 } | |
fn is_not_empty<T>(v : &[const T]) -> bool { !is_empty(v) } | |
fn same_length<T,U>(v : &[const T], w : &[const U]) -> bool { | |
v.len() == w.len() | |
} | |
fn reserve<T>(v : &[const T], n : uint) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math::sum; | |
fn is_empty<T>(v : &[const T]) -> bool { v.len() > 0 } | |
fn is_not_empty<T>(v : &[const T]) -> bool { !is_empty(v) } | |
fn same_length<T,U>(v : &[const T], w : &[const U]) -> bool { | |
v.len() == w.len() | |
} | |
fn reserve<T>(v : &[const T], n : uint) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use File::Find; | |
use Parse::RecDescent; | |
$::RD_HINT = 1; | |
#$::RD_TRACE = 1; | |
my $grammar = <<'HERE'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "main.h" | |
#include "txtmsg.h" | |
/* プログラムは WinMain から始まります */ | |
int | |
main (int argc, char *argv[]) | |
{ | |
parseArgs (argc, argv); | |
if (DxLib_Init () == -1) | |
return 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn foo(p: &a.memory_pool) -> &a.T { | |
let x: &a.T = new(*p) T; | |
ret x; // ok | |
} | |
fn bar() { | |
let pool: memory_pool = pool(); | |
let x = foo(pool); | |
// ... do something with x ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs | |
index c8f10f2..a6e392c 100644 | |
--- a/src/rustc/middle/trans/alt.rs | |
+++ b/src/rustc/middle/trans/alt.rs | |
@@ -35,11 +35,13 @@ fn opt_eq(tcx: ty::ctxt, a: opt, b: opt) -> bool { | |
} | |
} | |
-enum opt_result { | |
- single_result(result), |