// See the end of this file for copyright and license terms. use std::str::Chars; pub struct Lexer<'a> { stream: Chars<'a>, } impl <'a> Lexer<'a> { pub const fn new(stream: Chars<'a>) -> Lexer<'a> { Lexer { stream: stream, } } } #[derive(Debug)] pub struct Token { pub kind: TokenKind, pub line: usize, pub col: usize, } #[derive(Debug)] pub enum TokenKind { Semi, Ident(String), BoolLiteral(bool), IntLiteral(i64), StringLiteral(String), } impl <'a> Iterator for Lexer<'a> { type Item = Result; fn next(&mut self) -> Option> { // TODO None } } pub struct SyntaxError { pub msg: String, pub line: usize, pub col: usize, } // Copyright (C) 2021 Fefie // 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 . // // gayconf comes with ABSOLUTELY NO WARRANTY, to the extent // permitted by applicable law. See the CNPL for details.