Comments (3)
Issue-Label Bot is automatically applying the label bug
to this issue, with a confidence of 0.93. Please mark this comment with 👍 or 👎 to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
from py-tree-sitter.
I agree that .text would be highly useful, though
print(bytes.decode(code_bytes[child.start_byte:child.end_byte]))
gives the correct output per the playground, https://tree-sitter.github.io/tree-sitter/playground
from py-tree-sitter.
Yes, the code in your reproduction script is not correct. You are using the start_byte
and end_byte
to slice into a string, but that doesn't work: strings are sliced by character index, not byte index. As @andymass says, you would need to slice the code_bytes
array.
from py-tree-sitter.
Related Issues (20)
- Broken (?) README instructions to pip install pre-compiled binary wheels HOT 1
- Python 3.12 support for version 0.21.0 HOT 2
- both node ==None and node != None return False HOT 1
- Remove/replace the usage of distutils HOT 1
- Missing aarch64 packages for 0.21.x HOT 1
- Make the Node class hashable. HOT 1
- [tree-sitter-python] No matching distribution found for tree-sitter-python HOT 3
- Python nil pointer crash while iterating over query captures
- Results returned by `Query.matches()` and `Query.captures()` are different HOT 2
- FutureWarning: Language(path, name) is deprecated. HOT 1
- Deprecation warning `Language.build_library is deprecated. Use the new bindings instead` HOT 4
- Tree sitter gets stuck HOT 3
- Can't pip install tree-sitter-python on mac os with apple silicon HOT 1
- way to get parser for typescript/tsx HOT 2
- How to get the location of a variable name in the whole function?
- Does that mean it's a conversion error? HOT 2
- How to build 0.22.x from source HOT 1
- TypeError on initializing Language with tree_sitter_python after following example code in readme. HOT 2
- Replacement of `build_library`
- Fails to load language on 32 bit HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from py-tree-sitter.