Skip to content

Only replace long strings - #384

Merged
lorenzwalthert merged 7 commits into
r-lib:masterfrom
lorenzwalthert:long-strings-again
Apr 6, 2018
Merged

lorenzwalthert merged 7 commits into
r-lib:masterfrom
lorenzwalthert:long-strings-again

Conversation

@lorenzwalthert

@lorenzwalthert lorenzwalthert commented Mar 26, 2018 •

Copy link
Copy Markdown
Collaborator

Another attempt to solve #216, by implementing suggestion 2 suggested in #216 (comment). That is, only replace the strings that are necessary, not all strings if there is one string in the parse data that is longer than 1'000. This does (not yet) implement line / col substitution but returns an error if there is a problem, so we are failing fast instead of silently. I think it's rather unlikely that this is going to cause a problem in the future.

Also closes #383.

@lorenzwalthert

lorenzwalthert commented Apr 3, 2018 •

Copy link
Copy Markdown
Collaborator Author

@krlmlr there seems to be a bug in the R base parser of R3.1 with this example. It simply does not parse all tokens. I managed to reproduce it after painfully re-install R 3.1 and all packages needed on my Mac (this took forever, I also tried on Ubuntu and docker images). Can we skip a test based on R version? In principle, we should check whether the R version is below 3.2 and if so, check whether any non-terminal has no children and if so, throw an error.

@codecov-io

codecov-io commented Apr 3, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #384 into master will decrease coverage by 0.66%.
The diff coverage is 73.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
- Coverage   91.68%   91.02%   -0.67%     
==========================================
  Files          30       30              
  Lines        1479     1526      +47     
==========================================
+ Hits         1356     1389      +33     
- Misses        123      137      +14
Impacted Files Coverage Δ
R/parse.R 78.66% <73.77%> (-21.34%) ⬇️
R/utils.R 92.59% <0%> (+7.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8efd035...32d447b. Read the comment docs.

@lorenzwalthert

lorenzwalthert commented Apr 6, 2018 •

Copy link
Copy Markdown
Collaborator Author

In principle, we should check whether the R version is below 3.2 and if so, check whether any non-terminal has no children and if so, throw an error.

This is implemented with e85b29c.

@lorenzwalthert
lorenzwalthert force-pushed the long-strings-again branch 2 times, most recently from 7b196c6 to 5dab0a3 Compare April 6, 2018 22:03
fix misnomer of `verify_str_txt()`, better variable names within this function, outsource identification of insufficiently parsed strings in identify_insufficiently_parsed_stings(), add line and col check.
@lorenzwalthert
lorenzwalthert merged commit 6e2b326 into r-lib:master Apr 6, 2018
@lorenzwalthert
lorenzwalthert deleted the long-strings-again branch November 18, 2018 20:54
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.

Trailing quotations are dropped after accents

2 participants