Skip to content
Snippets Groups Projects
Select Git revision
  • fee50aa28e6303fe91bd3f34bc6fadfc906c79f2
  • master default protected
  • home_exam
  • wip
4 results

tmp.rs

Blame
  • Forked from Per Lindgren / D7050E
    Source project has a limited visibility.
    tmp.rs 646 B
    use crust::{
        ast::Span,
        parse::{parse_assign, test},
    };
    
    fn main() {
        // test("- -1 + + 1", - -1 + 1);  // rust does not allow + as a unary op (I do ;)
        // test("(-1-1)+(-1+3)", (-1 - 1) + (-1) + 3);
        // // just to check that right associative works (you don't need to implement pow)
        // test("2+3**2**3*5+1", 2 + 3i32.pow(2u32.pow(3)) * 5 + 1);
        // test("(12*2)/3-4", (12 * 2) / 3 - 4);
        // test("1*2+3", 1 * 2 + 3);
        // // just to check that we get a parse error
        // test("1*2+3+3*21-a12+2", 1 * 2 + 3 + 3 * 21 - 12 + 2);
        test("1 + a(1, 2)", 1 + 2);
        println!("{:?}", parse_assign(Span::new("3 = 4")));
    }