Skip to content

Commit 92088b3

Browse files
authored
Merge branch 'main' into 249-code_dependency
2 parents 9b79daa + 3b0935c commit 92088b3

File tree

6 files changed

+30
-8
lines changed

6 files changed

+30
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ default_language_version:
66
python: python3
77
repos:
88
- repo: https://github.com/lorenzwalthert/precommit
9-
rev: v0.4.3.9003
9+
rev: v0.4.3.9009
1010
hooks:
1111
- id: style-files
1212
name: Style code with `styler`

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: teal.code
33
Title: Code Storage and Execution Class for 'teal' Applications
4-
Version: 0.6.1.9000
5-
Date: 2025-02-14
4+
Version: 0.6.1.9001
5+
Date: 2025-05-20
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
88
person("Aleksander", "Chlebowski", , "[email protected]", role = "aut"),

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# teal.code 0.6.1.9000
1+
# teal.code 0.6.1.9001
22

33
### Bug fixes
44

R/qenv-eval_code.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,14 @@ setMethod("eval_code", signature = c("qenv", "expression"), function(object, cod
9898
if (length(srcref)) {
9999
eval_code(object, code = paste(attr(code, "wholeSrcref"), collapse = "\n"))
100100
} else {
101-
Reduce(eval_code, init = object, x = code)
101+
Reduce(function(u, v) {
102+
if (inherits(v, "=") && identical(typeof(v), "language")) {
103+
# typeof(`=`) is language, but it doesn't dispatch on it, so we need to
104+
# explicitly pass it as first class of the object
105+
class(v) <- unique(c("language", class(v)))
106+
}
107+
eval_code(u, v)
108+
}, init = object, x = code)
102109
}
103110
})
104111

inst/WORDLIST

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
Forkers
22
Hoffmann
3-
Reproducibility
43
funder
54
qenv
6-
repo
7-
reproducibility

tests/testthat/test-qenv_within.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,21 @@ testthat::test_that("within run on qenv.error returns the qenv.error as is", {
131131

132132
testthat::expect_identical(qe, qee)
133133
})
134+
135+
testthat::describe("within run with `=`", {
136+
testthat::it("single expression", {
137+
q <- qenv()
138+
q <- within(q, {
139+
i = 1 # nolintr: assigment. styler: off.
140+
})
141+
})
142+
143+
testthat::it("multiple '=' expressions", {
144+
q <- qenv()
145+
q <- within(q, {
146+
j = 2 # nolintr: assigment. styler: off.
147+
i = 1 # nolintr: assigment. styler: off.
148+
})
149+
testthat::expect_equal(q$i, 1)
150+
})
151+
})

0 commit comments

Comments
 (0)