From 26d88c2f9131cea4beb736923041e0891ae59794 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 4 Mar 2022 19:25:15 +0100 Subject: [PATCH] Set line to 1 by default in the tok structure Signed-off-by: Username404 --- src/headers/lex.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/headers/lex.hpp b/src/headers/lex.hpp index bb418e5..8035055 100644 --- a/src/headers/lex.hpp +++ b/src/headers/lex.hpp @@ -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 lex(const std::string& in);