How could I handle title depth in org-mode ? #876
Unanswered
marius851000
asked this question in
Q&A
Replies: 1 comment
-
So I found that tree-sitter-python have a similar system with tabulation. Will read how it's done. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to use tree-sitter to create a tree for the org file. I have a potentially infinite depth of section. For example :
This is similar to what is possible in with "#" in markdown. However, for folding reason, I would like to make
section
rule, that embed (for exemple) both* level 1
, it's content and all child section. I could represent this like :I finally found that I could implement that with C code, and that's what I did (this one doesn't compile to wasm due to printf):
and
However, with this test file :
It work as expected for the native version ("heading_more_level"), but the wasm version display and error and detect "heading_same_level". (but can hardly do more debugging due to not having printf).
The stdout is:
What seem strange to me is that it deserialize before any serialisation, and I suspect that the result is caused by buffer defaulting to 0 in linux, but default to 1 in wasm for some reason.
I need help to understand why this doesn't, and ideally how I should make this work (are there a better way to handle this kind of syntax ? I can't base myself on tree-sitter-markdown syntax, as it doesn't implement this feature.
(I will add that I don't have a good knowledge of C)
Thank.
Beta Was this translation helpful? Give feedback.
All reactions