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
goyox86@7031-jnarvaez:~/Code/rust/blog|master⚡ | |
⇒ cargo build | |
Compiling blog v0.1.0 (file:///Users/goyox86/Code/rust/blog) | |
error: macro undefined: 'options!' | |
--> src/main.rs:11:1 | |
| | |
11 | include!("lib.in.rs"); | |
| ^^^^^^^^^^^^^^^^^^^^^^ | |
| | |
= note: this error originates in a macro outside of the current crate |
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
func lev(s: String, t: String) -> Int { | |
if s == t { return 0 } | |
let sLen = s.characters.count | |
let tLen = t.characters.count | |
if sLen == 0 { return tLen } | |
if tLen == 0 { return sLen } | |
var d: [[Int]] = [] |
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
cargo build --release | |
Compiling rust-iron v0.0.1 (file:///Users/goyox86/Code/zendesk/zodiac-ingest-framework-benchmarks/rust-iron) | |
error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` | |
--> src/main.rs:33:19 | |
| | |
33 | let handler = move |request: &mut Request| { | |
| ^ | |
| | |
note: the requirement to implement `Fn` derives from here | |
--> src/main.rs:50:12 |
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
[ | |
ClassDecl( | |
Class { | |
identifier: ConstExpr( | |
Constant { | |
name: "Factorial" | |
} | |
), | |
methods: [ | |
MethodDecl( |
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
# Declare tokens produced by the lexer | |
token IF ELSE | |
token DEF | |
token CLASS | |
token NEWLINE | |
token NUMBER | |
token STRING | |
token TRUE FALSE NIL | |
token IDENTIFIER | |
token CONSTANT |
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
token IF ELSE | |
token DEF | |
token CLASS | |
token NEWLINE | |
token NUMBER | |
token STRING | |
token TRUE FALSE NIL | |
token IDENTIFIER | |
token CONSTANT |
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
pub use lexer::{Lexer, Token}; | |
pub struct Parser<'a> { | |
token: Token, | |
lexer: Lexer<'a> | |
} | |
impl<'a> Parser<'a> { | |
pub fn new(input: &'a str) -> Parser<'a> { | |
let mut lexer = Lexer::new(&input); |
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
class Awesome: | |
def does_it_work: | |
"yeah!" | |
awesome_object = Awesome.new | |
if awesome_object: | |
print("awesome_object.does_it_work = ") |
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
#![feature(str_char)] | |
use std::io::prelude::*; | |
use std::io::BufReader; | |
use std::fs::File; | |
const EOF: u8 = 0; | |
enum Token { | |
Constant(String), |
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
#[macro_use] extern crate nickel; | |
extern crate time; | |
use nickel::{Nickel, HttpRouter}; | |
use std::collections::HashMap; | |
use std::string::String; | |
use std::fmt; | |
use time::Tm; | |