From 23c7e5e6bba112b8025e8dbdf3ca631219c0874a Mon Sep 17 00:00:00 2001 From: AWE Henry Date: Wed, 17 Jan 2024 09:26:31 +0800 Subject: [PATCH] Small update --- example/info.cpp | 2 +- example/playground/ipapilio.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/example/info.cpp b/example/info.cpp index 258b30e..7ff25d1 100644 --- a/example/info.cpp +++ b/example/info.cpp @@ -7,7 +7,7 @@ int main() println("Papilio Charontis version {0[0]}.{0[1]}.{0[2]}", get_version()); println(); - println("__cpluscplus = {}", __cplusplus); + println("__cplusplus = {}", __cplusplus); #ifdef PAPILIO_COMPILER_MSVC println("PAPILIO_COMPILER_MSVC = {}", PAPILIO_COMPILER_MSVC); diff --git a/example/playground/ipapilio.cpp b/example/playground/ipapilio.cpp index da39381..9b28b3c 100644 --- a/example/playground/ipapilio.cpp +++ b/example/playground/ipapilio.cpp @@ -6,7 +6,7 @@ namespace detail { -std::string input(std::istream& is, std::string_view prefix = "") +static std::string input(std::istream& is, std::string_view prefix = "") { if(prefix.empty()) papilio::print("> "); @@ -199,13 +199,13 @@ void ipapilio::run() utf::string_ref parsed(fmt.begin(), e.get_iter()); script::script_error_code ec = e.error_code(); - std::size_t len = parsed.length(); + std::size_t pos = parsed.length() + 1; papilio::println("{}", fmt); - papilio::println("{:~>{}}", '^', len + 1); + papilio::println("{:~>{}}", '^', pos); papilio::println( "{: >{}} (0x{:X})", to_string(ec), - len + 1, + pos, static_cast>(ec) ); return; @@ -215,13 +215,13 @@ void ipapilio::run() if(e.error_code() == script::script_error_code::end_of_string) { const script::script_error_code ec = script::script_error_code::end_of_string; - std::size_t len = fmt.length(); + std::size_t pos = fmt.length() + 1; papilio::println("{}", fmt); - papilio::println("{:~>{}}", '^', len + 1); + papilio::println("{:~>{}}", '^', pos); papilio::println( "{: >{}} (0x{:X})", to_string(ec), - len + 1, + pos, static_cast>(ec) ); }