1
0
Fork 0

Merging upstream version 20.4.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:18:34 +01:00
parent 1194ddb03c
commit e4ef535ed9
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
20 changed files with 562 additions and 52 deletions

View file

@ -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()?,
))
})
}
}