This file contains 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
use std::uint; | |
use std::io; | |
use std::str; | |
enum Token { | |
Add, | |
Sub, | |
Inc, | |
Dec, | |
Out, |
This file contains 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
#[ link(name = "frscript", | |
vers = "0.0", | |
uuid = "62527026-e47c-44ce-be34-7137e8194772") ]; | |
#[ desc = "FRP Scripting Language" ]; | |
#[ license = "Zlib/libpng" ]; | |
#[ author = "tiffany" ]; | |
#[ crate_type="lib" ]; |
This file contains 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
parse.rs:172:25: 172:47 error: cannot determine a type for this bounded type parameter: unconstrained type | |
parse.rs:172 Ok(Token {value: TokenCreator::<T>::raw(text.slice(start, end).to_owned()), line: LineInfo::new(text, start+position, end+position)}) | |
^~~~~~~~~~~~~~~~~~~~~~ |
This file contains 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
use parse::*; | |
#[deriving(Clone)] | |
pub struct Prefix { | |
nick: ~str, | |
user: ~str, | |
host: ~str | |
} | |
impl ToStr for Prefix { |
This file contains 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
// ==UserScript== | |
// @name HTML5 video using VLC plugin | |
// @grant none | |
// @include * | |
// ==/UserScript== | |
function html5vlc(){ | |
var videos = document.getElementsByTagName("video"); | |
var embeds = new Array(videos.length); | |
for (var i = 0; i < videos.length; i++) { | |
var vlc = document.createElement("embed"); |
This file contains 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
use std::str::*; | |
use std::hashmap::*; | |
pub trait Parser<T>:Clone { | |
fn parse(&mut self, text: &str, position: uint) -> Result<Token<T>, SyntaxError>; | |
fn clone_as_owned_trait(&self) -> ~Parser<T>; | |
} | |
impl<T> Clone for ~Parser<T> { | |
fn clone(&self) -> ~Parser<T> { |
This file contains 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
let res = parse(&grammar, grammar.grammar.get(& &"repl-stat"), line, 0) .map_err(|e| pretty_error(e.line, e.to_str())) | |
.and_then(|tree| build_ast(&mut state.global, tree.clone()) .map_err(|e| pretty_error(e.line, e.to_str()))) | |
.and_then(|ast| expand_macros(&mut state, ast.clone()) .map_err(|e| pretty_error(e.line, e.to_str()))) | |
.and_then(|ast| typecheck(&mut state.global, ast.clone(), ~[]) .map_err(|e| pretty_error(e.line, e.to_str()))) | |
.and_then(|ast| eval(&mut state, ast, ~[]) .map_err(|e| pretty_error(e.line, e.to_str()))); |
This file contains 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
use std::str::*; | |
use std::hashmap::*; | |
trait CloneParser<T> { | |
fn clone_as_parser(&self) -> ~Parser<T>; | |
} | |
impl<T, U: Clone+Parser<T>> CloneParser<T> for U { | |
fn clone_as_parser(&self) -> ~Parser<T> { | |
~self.clone() as ~Parser<T> |
This file contains 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
data foo :: trait { | |
bar :: int -> int, | |
baz :: char array | |
} | |
data foobar :: struct { | |
val :: int | |
} |
This file contains 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
total 82M | |
-rwxr-xr-x 1 tiffany tiffany 34M Dec 3 17:22 gdb.exe* | |
-rwxr-xr-x 1 tiffany tiffany 20M Dec 3 16:30 libicudata50.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.8M Dec 3 16:30 icui18n50.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.5M Dec 3 16:30 libevent-2-0-5.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.4M Dec 3 16:30 libgettextlib-0-18-3.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.3M Dec 3 16:30 icuuc50.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.2M Dec 3 16:33 libgfortran-3.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.2M Dec 3 16:30 libgio-2.0-0.dll* | |
-rwxr-xr-x 1 tiffany tiffany 1.2M Dec 3 16:30 libglib-2.0-0.dll* |