mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-26 21:08:45 +08:00
optimize codes
This commit is contained in:
+2
-3
@@ -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;}
|
||||
|
||||
Reference in New Issue
Block a user