From 97144fb2271b9bd749deac2eb3537103d9513182 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 24 Dec 2023 08:49:56 +0100 Subject: Adding upstream version 20.4.0. Signed-off-by: Daniel Baumann --- sqlglotrs/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sqlglotrs') diff --git a/sqlglotrs/src/lib.rs b/sqlglotrs/src/lib.rs index c962887..43e90dc 100644 --- a/sqlglotrs/src/lib.rs +++ b/sqlglotrs/src/lib.rs @@ -71,7 +71,18 @@ impl Token { impl Token { #[pyo3(name = "__repr__")] fn python_repr(&self) -> PyResult { - Ok(format!("{:?}", self)) + Python::with_gil(|py| { + Ok(format!( + "", + self.token_type_py.as_ref(py).repr()?, + self.text.as_ref(py).repr()?, + self.line, + self.col, + self.start, + self.end, + self.comments.as_ref(py).repr()?, + )) + }) } } -- cgit v1.2.3