aboutsummaryrefslogtreecommitdiff
path: root/asm/lexer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'asm/lexer.cpp')
-rw-r--r--asm/lexer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/asm/lexer.cpp b/asm/lexer.cpp
index 8b30c55..42ea5eb 100644
--- a/asm/lexer.cpp
+++ b/asm/lexer.cpp
@@ -396,3 +396,17 @@ lerr_t tokenise_buffer(string_view source, std::vector<token_t> &tokens)
}
return lerr_t::OK;
}
+
+std::ostream &operator<<(std::ostream &os, token_t &t)
+{
+ return os << "TOKEN[" << token_type_as_cstr(t.type) << "(`" << t.content
+ << "`)@" << t.line << ", " << t.column << "]";
+}
+
+token_t::token_t()
+{}
+
+token_t::token_t(token_type_t type, string content, size_t col, size_t line)
+ : type{type}, column{col}, line{line}, content{content}
+{}
+