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

Hard to parse inline parsing error #2173

Closed
3 tasks done
hadley opened this issue Sep 20, 2022 · 3 comments · Fixed by #2198
Closed
3 tasks done

Hard to parse inline parsing error #2173

hadley opened this issue Sep 20, 2022 · 3 comments · Fixed by #2198
Assignees

Comments

@hadley
Copy link
Contributor

hadley commented Sep 20, 2022

It's hard for me to understand this error (which I think is new in 3cbf47f)

knitr::knit(text = "`r 1 + `", quiet = TRUE)
#> Quitting from lines 1-1 (cilia-stag_reprex.spin.Rmd)
#> Error: Failed to parse the inline R code: 1 +  (Reason: <text>:2:0: unexpected end of input
#> 1: 1 + 
#>    ^)

Created on 2022-09-20 with reprex v2.0.2

I'd find it easier to understand if it was more like:

#> Error: Failed to parse the inline R code: `1 + `
#> Reason: <text>:2:0: unexpected end of input
#> 1: 1 + 
#>    ^

By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('knitr'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('yihui/knitr').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui yihui moved this to To discuss / To plan in R Markdown Team Projects Nov 22, 2022
@rich-iannone rich-iannone self-assigned this Nov 22, 2022
@yihui yihui moved this from To discuss / To plan to Todo In Progress in R Markdown Team Projects Nov 24, 2022
yihui added a commit that referenced this issue Dec 22, 2022
…parsed, and write the reason to the next line (#2198)

Co-authored-by: Yihui Xie <[email protected]>
Repository owner moved this from Todo In Progress to Done in R Markdown Team Projects Dec 22, 2022
@yihui
Copy link
Owner

yihui commented Dec 22, 2022

Thanks! The error message includes `r ` now, and the reason is written to the next line:

#> Error: Failed to parse the inline R code: `r 1 + `
#> Reason: <text>:2:0: unexpected end of input
#> 1: 1 + 
#>    ^

@hadley
Copy link
Contributor Author

hadley commented Dec 22, 2022

Much better, thanks!

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants