Comments (7)
hey @414owen, what's the reason for this being an assert
?
assert(to_copy <= TREE_SITTER_SERIALIZATION_BUFFER_SIZE);
I'd say there's a good chance that's what you're hitting here, @lf-
and also
chonkpad
😁
from tree-sitter-haskell.
Huh, that's cool. I didn't know editors highlighted markdown blocks at all.
I'll have a proper look tomorrow evening, but is it possible a realloc failed?
from tree-sitter-haskell.
@414owen I assumed it's not related to the markdown, but the "pretty big haskell file". though that size limit should only be hit as a consequence of nesting, shouldn't it?
in any case, the backtrace shows the error to be caused by __assert_fail
, called from scanner_serialize
, where this buffer size assert is, so I think that's a safe bet
from tree-sitter-haskell.
the scanner in the Python grammar simply cuts off the buffer at the size limit, so should we maybe replace the assert
with that?
from tree-sitter-haskell.
Right, gotcha.
What we had before was presumably undefined behaviour, so I added the assert.
A few other projects seem to not copy the buffer at all if it's too large.
The docs say For your parser to work correctly, the serialize function must store its entire state, and deserialize must restore the entire state
. Whether or not his means we'll be buggy either way, I'm not sure. @maxbrunsfeld would it be possible to add a line to the docs about what to do if you simply don't have enough buffer space?
One thing we could do, is we could store uint8_t
s for the indents, instead of uint16_t
. That way, we'd be able to support files that have twice as many lexically nested layout-dependent constructs, but we'd only support indents only up to 255 chars.
I'll make a PR where we just don't copy the buffer at all. Not sure what @lf- will see visually in their markdown file after that.
@lf- I know you can't reveal the contents of your file, but maybe you could you tell us what the many layout-defining constructs are?
from tree-sitter-haskell.
The odd thing is that it is what I would call a pretty normal markdown file. I could lorem ipsum it and mechanically rename everything in the code blocks if you'd like. Frustratingly there's not an obvious repro, it just happened while writing in this file. Also, I'm very intrigued at why this parser is getting invoked with the particular stack trace that it is: called under pop-up menu completion (i use coc, which shouldn't do anything with treesitter there, so I'm very intrigued).
I would kill to have symbols or at least context? parser state? anything for all this, so I might figure out how to convince Nix to build a neovim and luajit and the treesitter plugin with symbols. No promises though, given it's work code and kinda a yak shave.
from tree-sitter-haskell.
mysterious!
from tree-sitter-haskell.
Related Issues (20)
- Combining characters in identifiers are not parsed correctly HOT 1
- Include . from qualified modules and variables HOT 6
- Segfault on large files (in Neovim) HOT 1
- Upgrade node-gyp dependency HOT 2
- Components parser as type when they are not HOT 1
- Include ! from strictness annotations
- exp_section_right not parsed when containing a hash HOT 3
- Incorrect parse for function with where-clause and comments HOT 4
- Can't npm install tree-sitter-haskell on Mac M3 Node.js v20.10? HOT 1
- Incorrect parse due to top-level splices HOT 11
- Failed builds due to very big file(s). HOT 3
- Qualified/unqualified module paths colored differently HOT 3
- Typed Template Haskell quotations / splices not handled correctly HOT 3
- "finally" is highlighted like a language keyword HOT 1
- Instance with associated type, following TH top level splice, misparsed as function HOT 2
- Misparse of explicit-braced code
- UnicodeSyntax support HOT 10
- "undefined symbol: tree_sitter_haskell_external_scanner_create" when running "tree-sitter test" HOT 7
- Support `OverloadedRecordDot` HOT 8
- I added three more symbols for built-in syntax.
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 tree-sitter-haskell.