[lexer] Obey Rust book recommendation about order of leading lines
This commit is contained in:
parent
0ed4aa3ae5
commit
d69c3dbc31
3 changed files with 7 additions and 7 deletions
|
@ -2,6 +2,9 @@
|
||||||
* Eryn Wells <eryn@erynwells.me>
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use std::iter::Peekable;
|
||||||
|
use states::*;
|
||||||
|
|
||||||
mod chars;
|
mod chars;
|
||||||
mod error;
|
mod error;
|
||||||
mod states;
|
mod states;
|
||||||
|
@ -10,9 +13,6 @@ mod token;
|
||||||
pub use error::Error;
|
pub use error::Error;
|
||||||
pub use token::{Lex, Token};
|
pub use token::{Lex, Token};
|
||||||
|
|
||||||
use std::iter::Peekable;
|
|
||||||
use states::*;
|
|
||||||
|
|
||||||
pub type Result = std::result::Result<Lex, Error>;
|
pub type Result = std::result::Result<Lex, Error>;
|
||||||
|
|
||||||
pub struct Lexer<T> where T: Iterator<Item=char> {
|
pub struct Lexer<T> where T: Iterator<Item=char> {
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
extern crate sibillexer;
|
extern crate sibillexer;
|
||||||
|
|
||||||
use std::io::prelude::*;
|
|
||||||
use std::io;
|
use std::io;
|
||||||
|
use std::io::Write;
|
||||||
use sibillexer::Lexer;
|
use sibillexer::Lexer;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
* Eryn Wells <eryn@erynwells.me>
|
* Eryn Wells <eryn@erynwells.me>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use std::fmt::Debug;
|
||||||
|
use token::Token;
|
||||||
|
|
||||||
mod begin;
|
mod begin;
|
||||||
mod hash;
|
mod hash;
|
||||||
mod id;
|
mod id;
|
||||||
|
|
||||||
pub use self::begin::Begin;
|
pub use self::begin::Begin;
|
||||||
|
|
||||||
use std::fmt::Debug;
|
|
||||||
use token::Token;
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum StateResult {
|
pub enum StateResult {
|
||||||
/// Consume the character, remain on this state.
|
/// Consume the character, remain on this state.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue