From 2d4879b69fb4a2140ac5967f0d620c15db29437e Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Thu, 12 Dec 2024 10:40:38 +0100 Subject: [PATCH] include col/line information --- runtime/json.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/json.hpp b/runtime/json.hpp index 7a0eb52..baffd4c 100644 --- a/runtime/json.hpp +++ b/runtime/json.hpp @@ -253,7 +253,16 @@ public: } private: - inline void step() { this->i += 1; } + inline void step() + { + if (this->cur() == '\n') { + this->col = 1; + this->line += 1; + } else { + this->col += 1; + } + this->i += 1; + } inline auto intern_str(std::string val) -> size_t {