#![doc = include_str!("readme.md")]
pub mod token_type;
pub use token_type::CobolTokenType;
use crate::language::CobolLanguage;
use oak_core::{Lexer, LexerCache, LexerState, OakError, lexer::LexOutput, source::Source};
pub struct CobolLexer;
impl CobolLexer {
pub fn new() -> Self {
Self
}
}
impl Lexer<CobolLanguage> for CobolLexer {
fn lex<'a, S: Source + ?Sized>(&self, source: &'a S, _edits: &[oak_core::source::TextEdit], cache: &'a mut impl LexerCache<CobolLanguage>) -> LexOutput<CobolLanguage> {
let mut state = LexerState::new_with_cache(source, 0, cache);
state.add_eof();
state.finish_with_cache(Ok(()), cache)
}
}