pub fn new(input: &str) -> Self {
        let mut data = Vec::new();
        data.extend_from_slice(input.as_bytes());
        let end = data.len() as i32;
        //let data = vec![input.as_bytes()];
        //let bytes = data.as_bytes();
        //let end = bytes.len() as i32;
        Scanner {
            data,
            ps: 0,
            p: 0,
            pe: end,
            eof: end,
            last_newline: 0,
            cur_line: 1,
            token: TokenType::Illegal,
            checkpoint: 0,
            checkpoint_line: 1,
            checkpoint_last_newline: 0,
            positions: HashMap::default(),
            comments: Vec::new(),
        }
    }
/// Create a new scanner with the provided input.
Create a new scanner with the provided input.
Create a new scanner with the provided input .
pub fn new(input: &str) -> Self {
        let mut data = Vec::new();
        data.extend_from_slice(input.as_bytes());
        let end = data.len() as i32;
        //let data = vec![input.as_bytes()];
        //let bytes = data.as_bytes();
        //let end = bytes.len() as i32;
        Scanner {
            data,
            ps: 0,
            p: 0,
            pe: end,
            eof: end,
            last_newline: 0,
            cur_line: 1,
            token: TokenType::Illegal,
            checkpoint: 0,
            checkpoint_line: 1,
            checkpoint_last_newline: 0,
            positions: HashMap::default(),
            comments: Vec::new(),
        }
    }
pub fn new ( input : & str ) -> Self { let mut data = Vec :: new ( ) ; data . extend_from_slice ( input . as_bytes ( ) ) ; let end = data . len ( ) as i32 ; //let data = vec![input.as_bytes()]; //let bytes = data.as_bytes(); //let end = bytes.len() as i32; Scanner { data , ps : 0 , p : 0 , pe : end , eof : end , last_newline : 0 , cur_line : 1 , token : TokenType :: Illegal , checkpoint : 0 , checkpoint_line : 1 , checkpoint_last_newline : 0 , positions : HashMap :: default ( ) , comments : Vec :: new ( ) , } }
Create a new scanner with the provided input.
Create a new scanner with the provided input .
input
&str
input
&str