You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
923 B
Rust

// See the end of this file for copyright and license terms.
use std::env;
use std::fs;
mod lex;
fn main() {
let argv: Vec<String> = env::args().collect();
if argv.len() != 2 {
panic!("Usage: {} <file>", &argv[0]);
}
let s = fs::read_to_string(&argv[0]).expect("Cannot open file ");
let lex = lex::Lexer::new(s.chars());
for token in lex {
match token {
Ok(t) => println!("{:?}", t),
Err(_) => panic!("qwq"),
}
}
}
// Copyright (C) 2021 Fefie <owo@fef.moe>
// This file is part of gayconf.
//
// gayconf is ethical software: you can use, redistribute,
// and/or modify it under the terms of the CNPLv5+ as found
// in the LICENSE file in the source code root directory or
// at <https://git.pixie.town/thufie/CNPL>.
//
// gayconf comes with ABSOLUTELY NO WARRANTY, to the extent
// permitted by applicable law. See the CNPL for details.