Help with using curly braces instead of angular brackets #1

Closed
opened 2022-02-08 15:54:40 +01:00 by Charuru · 3 comments
Charuru commented 2022-02-08 15:54:40 +01:00 (Migrated from github.com)

I'm looking to learn how to parse a language similar to XML but with curly braces instead of angular brackets. Really having a hard time understanding the grammar file and making the change.

Help please thanks!

I'm looking to learn how to parse a language similar to XML but with curly braces instead of angular brackets. Really having a hard time understanding the grammar file and making the change. Help please thanks!
marijnh commented 2022-02-08 16:04:00 +01:00 (Migrated from github.com)

This is a really inefficient way to ask for help. You didn't tell us what you are doing and what is going wrong, you just provided a vague sketch of something, for which there exist working examples (say, the XML parser). Also, this is the bug tracker, not a place to ask for help. If you want to try to ask in a more constructive way, give the forum a try.

This is a really inefficient way to ask for help. You didn't tell us what you are doing and what is going wrong, you just provided a vague sketch of something, for which there exist working examples (say, the XML parser). Also, this is the bug tracker, not a place to ask for help. If you want to try to ask in a more constructive way, give [the forum](https://discuss.codemirror.net/c/lezer) a try.
Charuru commented 2022-02-08 16:10:00 +01:00 (Migrated from github.com)

Thanks, sorry about the bad issue. I'm trying to fork this XML parser into a custom parser that works basically identically but with curlys instead of angular brackets.

From what I understand of the documentation that's available in xml.grammar? But confusingly there's stuff about EndTag

EndTag[openedBy="StartTag StartCloseTag"] { ">" }

but nothing about StartTag?

I forked the lang-html repo and was able to replace most '>' with '}', and it autocloses with {/tag}. But I can't seem to find the place to edit the start.

So it looks like this:

<tag}{/tag}

I'm just blindly replacing things is there somewhere with documentation where I can learn about this properly? Thanks for making great software.

Thanks, sorry about the bad issue. I'm trying to fork this XML parser into a custom parser that works basically identically but with curlys instead of angular brackets. From what I understand of the documentation that's available in xml.grammar? But confusingly there's stuff about EndTag `EndTag[openedBy="StartTag StartCloseTag"] { ">" }` but nothing about StartTag? I forked the lang-html repo and was able to replace most '>' with '}', and it autocloses with {/tag}. But I can't seem to find the place to edit the start. So it looks like this: `<tag}{/tag}` I'm just blindly replacing things is there somewhere with documentation where I can learn about this properly? Thanks for making great software.
marijnh commented 2022-02-08 16:37:09 +01:00 (Migrated from github.com)

StartTag is declared in the @external tokens startTag from "./tokens.js" block, meaning it is generated by a programmatic tokenizer in tokens.js

`StartTag` is declared in the `@external tokens startTag from "./tokens.js"` block, meaning it is generated by a programmatic tokenizer in tokens.js
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/xml#1
No description provided.