Set line to 1 by default in the tok structure
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
9d7300ce89
commit
26d88c2f91
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue