#133 code parser alternative - #146
Conversation
gogonzo
left a comment
There was a problem hiding this comment.
Looks like format_expression doesn't make sense anymore. We rather need style_string_code instead.
|
Hey @gogonzo this isn't working at all, I just pushed the code at the end of the day so it's secured by being send to a remote repository. It should be ready for testing today at the end of the day |
|
Hey @gogonzo and @chlebowa, an update for you!
And I'd like to incorporate few more feedback points from the other PR |
print error with specific (failing) call message
Co-authored-by: Aleksander Chlebowski <114988527+chlebowa@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
There was a problem hiding this comment.
I move that
- Only the generic constructor is mentioned in
usage.

new_qenv,eval_codebe documented in one file. Perhapsget_codeas well.
Also, since we do require the user to tag code lines, I wonder whether we should extend it to have them tag all lines and not try to find dependencies automatically.
Then we could simply
cc <- c("sp <- 'virginica' #@effect ii", "i <- iris #@effect ii", "ii <- subset(i, Species == sp) #@effect ii")
ex <- parse(text = cc)
lines <- attr(ex, "srcfile")$lines
# pseudo
l <- grep("@effect ii", lines, value = TRUE)
gogonzo
left a comment
There was a problem hiding this comment.
This fails
q <- new_qenv()
q <- eval_code(q, expression({
a <- 1
b <- 2
}))
testthat::expect_identical(
get_code(q, names = "a"),
"a <- 1"
)I think curly brackets should be removed either before inserting code to @code. Thanks to this trace in qenv.error will have no brackets also.
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
Co-authored-by: Dawid Kałędkowski <6959016+gogonzo@users.noreply.github.com> Signed-off-by: Marcin <133694481+m7pr@users.noreply.github.com>
|
It seems a |
|
Will have a look @chlebowa . You are good to go! |
|
I adapted |
- it is just a wrapper that works on a text or expression with srcref attributes - it is not included in get_code - it is separated from eval_code
…insightsengineering/teal.code into 133_code_parser_characters@main
|
Hey, we had a debate with @gogonzo on the final form of the current stage of code parser. @gogonzo would you mind taking a final look at the commit with recent changes that we discussed 193a52e |
gogonzo
left a comment
There was a problem hiding this comment.
code_dependency covers cases which we desperately needed in teal. I accept this solution which can be now implemented on the refactor branch, where we can detect edge cases. Please merge to main once GH checks pass
|
Amazing, created a card for potential minor improvements that we can provide in the future #154 |
Code Coverage SummaryDiff against mainResults for commit: 864cc52 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Fixes #133
Alternative to #139