Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

901 B
Raw Blame
#pragma once

#include <string>
#include <vector>

#include "antlr4-runtime.h"

std::string replace_common_escape_characters(std::string text);

std::string parse_string_literal_text(std::string text);

std::string parse_string_literal_ctx(antlr4::tree::TerminalNode* node);

std::string parse_string_text_ctx(antlr4::tree::TerminalNode* node, bool escape_quotes);

std::string join(const std::vector<std::string>& tokens, const std::string& sep);

void to_lower(std::string& s);

std::string to_lower_copy(const std::string& s);

void replace_all(std::string& str, const std::string& from, const std::string& to);

// Builds a human-readable message for an UNEXPECTED_CHARACTER token, naming
// the offending character by Unicode code point (essential when it is
// invisible — a zero-width space, a control character, …).
std::string describe_unexpected_character(const std::string& utf8_char);