Set line to 1 by default in the tok structure

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-03-04 19:25:15 +01:00
parent 9d7300ce89
commit 26d88c2f91
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -24,8 +24,8 @@ struct tok {
std::string toktext;
unsigned long line;
tok() = delete;
tok(const type& Type, std::string_view Text, const decltype(line)& line = 0): toktype(Type), toktext(Text), line(line) {}
explicit tok(const type& Type, const decltype(line)& line = 0): tok(Type, std::string(1, Type), line) {};
tok(const type& Type, std::string_view Text, const decltype(line)& line = 1): toktype(Type), toktext(Text), line(line) {}
explicit tok(const type& Type, const decltype(line)& line = 1): tok(Type, std::string(1, Type), line) {};
friend std::ostream& operator<<(std::ostream& output, const tok& it) { return output << it.toktext; }
};
std::vector<tok> lex(const std::string& in);