optimize codes

This commit is contained in:
ValKmjolnir
2022-04-12 18:26:54 +08:00
parent b6f174e869
commit 022460755f
6 changed files with 11 additions and 12 deletions
+2 -3
View File
@@ -93,12 +93,11 @@ struct token
uint32_t column;
uint32_t type;
std::string str;
token(uint32_t l=0,uint32_t c=0,uint32_t t=tok_null,std::string s="")
token(uint32_t l=0,uint32_t c=0,uint32_t t=tok_null,const std::string s=""):str(s)
{
line=l;
column=c;
type=t;
str=s;
}
};
@@ -119,7 +118,7 @@ private:
std::string num_gen();
std::string str_gen();
public:
nasal_lexer(nasal_err& e):nerr(e){}
nasal_lexer(nasal_err& e):line(0),column(0),ptr(0),nerr(e){}
void scan(const std::string&);
void print();
const std::vector<token>& get_tokens() const {return tokens;}