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

Refactor stringify expression and rescue trailing comments; fixes #89, fixes #91 #114

Merged
merged 6 commits into from
Sep 26, 2017

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented Sep 26, 2017

This includes @jimhester's commit from #112.

It also rescues any trailing comment lines (#89).
It does NOT rescue comments trailing off the end of the last expression (#91).

This should now retain original formatting, so we should not need to
reformat with formatR / styler
}

trailing_comments <- function(.srcfile, n) {
raw_lines <- .srcfile[["lines"]]
Copy link
Contributor

@jimhester jimhester Sep 26, 2017

Choose a reason for hiding this comment

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

I am pretty sure you can use utils::getSrcLines(.srcfile, n, Inf) to retrieve the lines you are looking for.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed!

@jennybc jennybc changed the title Refactor stringify expression Refactor stringify expression and rescue trailing comments; fixes #89, fixes #91 Sep 26, 2017
@jennybc jennybc merged commit d455304 into master Sep 26, 2017
@jennybc jennybc deleted the refactor-stringify-expression branch September 26, 2017 21:40
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