ruby / rbs

Type Signature for Ruby
Other
1.94k stars 208 forks source link

Inconsistencies and Holes in with Grammar documentation #1626

Open Forthoney opened 9 months ago

Forthoney commented 9 months ago

I found three issues with the syntax documentation

  1. proc is inconsistent In the "Types" section, proc's grammar is laid out as image But in the "Method Types" section, proc's grammar is laid out as image I believe the bottom one is correct, so we should change the first one to be accurate

  2. record-name, members are undefined As the header states, record-name and members are used several times but not defined in the document.

  3. inconsistency in representing repetition The document sometimes uses "etc." in the beginning and "..." towards the end to represent repeating 1 or more times. This is confusing from the reader. Also, there may be a typo that stems from this inconsistent use. For example, method-name's definition uses no quotes ... when I believe the intention is to say "..."

soutaro commented 9 months ago

@Forthoney

Thank you for reporting the issue.

Yeah, the proc syntax is duplicated and the second one is the correct. Will fix if. 🙏

About record-name and members, the syntax in the doc is not complete. We may add the definition of them...

The meaning of ... is not very clear. It usually means zero or one repetition. One in the method-name is a typo. Will fix it.

Forthoney commented 9 months ago

Thank you @soutaro for the quick response! Would it be possible for you to provide a draft of the definition of record-name and members sometime soon (meaning before an official pull request is made)? I am currently building a tree-sitter parser for RBS and hope to use this information to finish building the grammar.js file

ksss commented 9 months ago

@Forthoney [FYI] A tree-sitter parser for RBS already exists. https://github.com/joker1007/tree-sitter-rbs

Forthoney commented 9 months ago

@Forthoney [FYI] A tree-sitter parser for RBS already exists. https://github.com/joker1007/tree-sitter-rbs

Wow thanks for letting me know! I was not aware of its existence. I may contact the owner to notify them of this issue and perhaps collaborate with them to use the canonical definition of record-name and members once it is provided by the RBS team.