Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing architecture docs #534

Closed
OmarTawfik opened this issue Jul 11, 2023 · 0 comments · Fixed by #732
Closed

missing architecture docs #534

OmarTawfik opened this issue Jul 11, 2023 · 0 comments · Fixed by #732
Assignees

Comments

@OmarTawfik
Copy link
Contributor

OmarTawfik commented Jul 11, 2023

A new section under https://nomicfoundation.github.io/slang/user-guide/architecture/syntax

Document: CST

  • How it is a complete tree: every byte is a node.
  • What are rule nodes and what are token nodes.
  • How to navigate their children, etc…
  • How you can parse any ProductionKind, not just SourceUnit.

Document: Grammar

  • Grammar pages and navigating rules.
  • Mapping ebnf to rule and token kinds.
  • Inlined nodes.
  • Different EBNF operators.
  • How precedence and associativity are specified.

Document: Trivia

  • Leading vs trailing, and how they are grouped.
  • Why most tools will traverse the tree ignoring it
  • How an IDE or a formatter can use it to handle comments.
  • How to extract NatSpec and parse it externally for now.
    • Can users use available jsdoc parsers to post-process it?
    • Add note that it is on our roadmap to provide that API.

Document: Visitors

  • How each node stores lengths or text and how ranges are calculated during visits.
  • Different use cases + code examples.
    • Add note that it is on our roadmap to additionally provide cursors + rewriters.

Document: AST

  • Perhaps just a single paragraph about how we plan on providing a strong types for nodes.
  • Only built for successfully parsed CSTs.
  • How can they abstract over version differences.
  • Providing the same visitors + cursors + rewriters experience.
@OmarTawfik OmarTawfik modified the milestone: 2️⃣ Beta Preview Jul 11, 2023
@OmarTawfik OmarTawfik linked a pull request Feb 13, 2024 that will close this issue
@OmarTawfik OmarTawfik moved this to Done in Slang - 2024 H1 Feb 13, 2024
@OmarTawfik OmarTawfik self-assigned this Feb 15, 2024
@OmarTawfik OmarTawfik closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant