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

Scaladoc: implement parsing of tables #2059

Merged
merged 1 commit into from Jun 3, 2020
Merged

Conversation

kitbellew
Copy link
Contributor

@kitbellew kitbellew force-pushed the tables branch 2 times, most recently from 989228f to 0617139 Compare May 31, 2020 01:10
@kitbellew
Copy link
Contributor Author

@olafurpg any other modifications you could suggest? otherwise, I'd merge, tag and add to the formatter.

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Feel free to merge and cut a new release, just two minor comments. It would be good to ensure that there are no unexpected exceptions for example for empty header alignment rows

|a|
||

val delimLine = hspaces0 ~ CharsWhileIn("+-")
val sep = nl ~ (delimLine ~ nl).rep ~ tableSpaceSep
val table = row.rep(2, sep = sep).map { x =>
val rest = x.tail.map(_.map(_.trim))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know x is always non-empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will add a test but if i read the .rep(2) above correctly, it should have at least 2 elements.

Copy link
Contributor Author

@kitbellew kitbellew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Feel free to merge and cut a new release, just two minor comments. It would be good to ensure that there are no unexpected exceptions for example for empty header alignment rows

|a|
||

these two should not be parsed as a table, will test.

val delimLine = hspaces0 ~ CharsWhileIn("+-")
val sep = nl ~ (delimLine ~ nl).rep ~ tableSpaceSep
val table = row.rep(2, sep = sep).map { x =>
val rest = x.tail.map(_.map(_.trim))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will add a test but if i read the .rep(2) above correctly, it should have at least 2 elements.

@kitbellew kitbellew merged commit e7f2a8b into scalameta:master Jun 3, 2020
@kitbellew kitbellew deleted the tables branch June 3, 2020 16:48
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