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

Fix nested array parsing #1389

Merged
merged 1 commit into from
Sep 3, 2021
Merged

Fix nested array parsing #1389

merged 1 commit into from
Sep 3, 2021

Conversation

dduugg
Copy link
Contributor

@dduugg dduugg commented Jun 17, 2021

Description

Prior to this change, nested arrays would be missing closing brackets when translating back to source code, e.g.:

[1] pry(main)> YARD::Parser::Ruby::RubyParser.new('a[b[c]]', nil).parse.root.first.source
=> "a[b[c]"

This in turn would print warnings in YARD output, and result in documentation errors. Example warnings:

[warn]: Syntax error in `(stdin)`:(1,96): syntax error, unexpected end-of-input, expecting ']'
[warn]: ParserSyntaxError: syntax error in `(stdin)`:(1,96): syntax error, unexpected end-of-input, expecting ']'

This change corrects this specific problem. All tests pass, but this is a naïve fix, and I'm not familiar enough with this code to contemplate other potential side effects.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@lsegal lsegal merged commit 258add9 into lsegal:main Sep 3, 2021
@lsegal
Copy link
Owner

lsegal commented Sep 3, 2021

Sorry it took so long to get to this. Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants