summaryrefslogtreecommitdiffstats
path: root/sqlglotrs/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:49:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-12-24 07:49:59 +0000
commit43a52bccf5bf17217a2734f4680c00a102f82cac (patch)
treeb745cdd5b462b8f0fbd9b54390f4676a48aae33a /sqlglotrs/src/lib.rs
parentReleasing debian version 20.3.0-1. (diff)
downloadsqlglot-43a52bccf5bf17217a2734f4680c00a102f82cac.tar.xz
sqlglot-43a52bccf5bf17217a2734f4680c00a102f82cac.zip
Merging upstream version 20.4.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sqlglotrs/src/lib.rs')
-rw-r--r--sqlglotrs/src/lib.rs13
1 files changed, 12 insertions, 1 deletions
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<String> {
- Ok(format!("{:?}", self))
+ Python::with_gil(|py| {
+ Ok(format!(
+ "<Token token_type: {}, text: {}, line: {}, col: {}, start: {}, end: {}, comments: {}>",
+ 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()?,
+ ))
+ })
}
}