rhys-vdw / rhys-vdw/lua-doc-extractor
Class with key type instead of literal fails to parse and is dropped
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 3
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
This code:
/***
* @class Bad
* @field n integer
* @field [integer] string
*/
produces this error:
⚠ 'src/Bad.cpp'
✔ Done
ERRORS
'src/Bad.cpp': Error: Syntax error at line 3 col 9:
1 @field n integer
2 @field [integer] string
3
^
Unexpected identifier token: "integer". Instead, I was expecting to see one of the following:
indexKey → "[" _ ● %literal _ "]"
fieldAttr → %fieldAttr __ ● indexKey __ unionType unionDesc
Both luals and emmylua accept this syntax to describe a class with arbitrary keys of the given type.
When this error is emitted, the class in question is omitted from the output entirely.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the comment example, then search the parser or grammar for the reported indexKey and fieldAttr rules and the "Unexpected identifier" message. The work is done when a typed-key field such as [integer] string parses successfully and the containing class is retained in the generated output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 62/100