trying to get filename and linenumber

This commit is contained in:
Yehowshua Immanuel 2022-08-04 13:19:52 -04:00
parent fa25bad391
commit ba9208277b
7 changed files with 200 additions and 83 deletions

View file

@ -76,9 +76,7 @@ pub(super) fn ident(
) -> Result<(), String> {
// let keyword = "module";
let err : Result<(), String> = Err(format!("reached end of file without parser leaving ident"));
let word = word_reader.next_word();
let (word, cursor) = word.ok_or(err).unwrap();
let (word, cursor) = word_reader.next_word()?;
if word == keyword {
return Ok(())