Skip to content

Instantly share code, notes, and snippets.

View sophiajt's full-sized avatar

Sophia J. Turner sophiajt

View GitHub Profile
fn parse_if<'a>(input: &mut Peekable<TokenIterator<'a>>) -> Result<Stmt, ParseError> {
Ok(Stmt::Expr(Node::IntConst(3)))
}
fn parse_expr_stmt<'a>(input: &mut Peekable<TokenIterator<'a>>) -> Result<Stmt, ParseError> {
Ok(Stmt::Expr(Node::IntConst(4)))
}
fn parse_stmt<'a>(input: &mut Peekable<TokenIterator<'a>>) -> Result<Stmt, ParseError> {
let mut parser = match input.peek() {
fn simple_fn(x: i32) -> i32 {
x + 100
}
trait FooFn {
fn foo(&self);
}
impl FooFn for Fn(i32)->i32 {
fn foo(&self) {
//use std::fmt;
#include <iostream>
//
//struct Foo {
// x: i32
//}
struct Foo {