Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SaptakBhoumik committed Jun 4, 2022
1 parent ff98a81 commit 36f167e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Peregrine/lexer/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@
LEXER::LEXER(std::string input, std::string filename){
m_input = input;
m_filename = filename;
m_statments=split_ln(input);
if(m_input.size()>0){
m_statments=split_ln(input);
m_curr_item=m_input[0];
m_curr_line=m_statments[0];
lex();
complete_it();
}
else {
m_result.push_back(Token{
m_loc,
m_curr_line,
"<tk_eof>",
m_curr_index,
m_curr_index+1,
m_line,
tk_eof,
m_tab_count
});
}
complete_it();
}

void LEXER::add_unknown(){
Expand Down

0 comments on commit 36f167e

Please sign in to comment.