sharp 0.1.0

A modern, statically-typed programming language with Python-like syntax, compiled to native code via LLVM. Game engine ready!
1
2
3
4
5
6
7
8
9
10
11
12
use std::fs;

mod lexer;
use lexer::{Lexer, Token};

fn main() {
    let source = fs::read_to_string("examples/simple.shrp").unwrap();
    let lexer = Lexer::new(&source);
    for (token, span) in lexer {
        println!("{:?} @ {:?}", token, span);
    }
}