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

Allow missing space before @include #342

Merged
merged 3 commits into from Oct 6, 2015
Merged

Allow missing space before @include #342

merged 3 commits into from Oct 6, 2015

Conversation

@krlmlr
Copy link
Member

@krlmlr krlmlr commented May 27, 2015

This is inconsistent, other tags allow a space before @, but @include doesn't.

Includes a test.

There is code duplication, the detection of a roxygen comment is also encoded in LINE.DELIMITER (code ref) but there the caret (start of text indicator) is missing. What to do about that?

@hadley
Copy link
Member

@hadley hadley commented Oct 4, 2015

Could you please squash and add a bullet to NEWS?

@krlmlr
Copy link
Member Author

@krlmlr krlmlr commented Oct 6, 2015

Resolved conflict, added bullet to NEWS.

@krlmlr
Copy link
Member Author

@krlmlr krlmlr commented Oct 6, 2015

Squashed, too.

hadley added a commit that referenced this issue Oct 6, 2015
@hadley hadley merged commit 42d069e into r-lib:master Oct 6, 2015
1 check was pending
@hadley
Copy link
Member

@hadley hadley commented Oct 6, 2015

Thanks!

kevinushey
Copy link
Contributor

kevinushey commented on 26adf7c Oct 6, 2015

Choose a reason for hiding this comment

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

Why not just allow an arbitrary amount of whitespace? E.g. \\s*.

krlmlr
Copy link
Member

krlmlr commented on 26adf7c Oct 6, 2015

Choose a reason for hiding this comment

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

Is this allowed for the other tags?

kevinushey
Copy link
Contributor

kevinushey commented on 26adf7c Oct 6, 2015

Choose a reason for hiding this comment

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

It appears to be:

> roxygen2:::parse.preref("#'      @param foo bar")
$param
$param$name
[1] "foo"

$param$description
[1] "bar"

Although that's not explicitly indicated by the LINE.DELIMITER object. (It's possible that I'm just bikeshedding; but it would be unfortunate if this failed for some users who used multiple spaces, or tabs even, following the roxygen comment)

hadley
Copy link
Member

hadley commented on 26adf7c Oct 6, 2015

Choose a reason for hiding this comment

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

I'd be more in favour of making the specification stricter everywhere (i.e. requiring exactly one space)

@krlmlr krlmlr deleted the include-space branch May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants