The R Project SVN R

Rev

Rev 89536 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 89536 Rev 89543
Line 1... Line 1...
1
 
1
 
2
R Under development (unstable) (2026-03-03 r89525) -- "Unsuffered Consequences"
2
R Under development (unstable) (2026-03-05 r89541) -- "Unsuffered Consequences"
3
Copyright (C) 2026 The R Foundation for Statistical Computing
3
Copyright (C) 2026 The R Foundation for Statistical Computing
4
Platform: x86_64-pc-linux-gnu
4
Platform: x86_64-pc-linux-gnu
5
 
5
 
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
6
R is free software and comes with ABSOLUTELY NO WARRANTY.
7
You are welcome to redistribute it under certain conditions.
7
You are welcome to redistribute it under certain conditions.
Line 44... Line 44...
44
 
44
 
45
Asserted warning: bibtools.Rd:5: Could not find bibentries for the following keys:
45
Asserted warning: bibtools.Rd:5: Could not find bibentries for the following keys:
46
  'non-existent-key'
46
  'non-existent-key'
47
> 
47
> 
48
> ## Also test for changes in HTML conversion
48
> ## Also test for changes in HTML conversion
49
> Rd2HTML("bibtools.Rd", htmlfile <- tempfile(),
49
> Rd2HTML("bibtools.Rd", out <- "bibtools.html",
50
+         stages = "build", standalone = FALSE) |>
50
+         stages = "build", standalone = FALSE) |>
51
+     assertWarning() # the same
51
+     assertWarning() # the same
52
> ## FIXME: carry-over of unshown citation (cache not cleared)
52
> ## FIXME: carry-over of unshown citation (cache not cleared)
53
> Rdiff(htmlfile, "bibtools.html.save")
53
> if (!Rdiff(out, "bibtools.html.save")) unlink(out)
54
[1] 0
-
 
55
> 
54
> 
56
> ## Check cited but not shown
55
> ## Check cited but not shown
57
> pkgdir <- package.skeleton("bibtools", list = ".NotYetImplemented",
56
> pkgdir <- package.skeleton("bibtools", list = ".NotYetImplemented",
58
+                            path = tempdir()) |> suppressMessages()
57
+                            path = tempdir()) |> suppressMessages()
59
> file.copy("bibtools.Rd", file.path(pkgdir, "man")) |> stopifnot()
58
> file.copy("bibtools.Rd", file.path(pkgdir, "man")) |> stopifnot()
Line 63... Line 62...
63
 
62
 
64
attr(,"unexpected_macro_expansion")
63
attr(,"unexpected_macro_expansion")
65
[1] TRUE
64
[1] TRUE
66
> ## ("unexpected_macro_expansion" as there is no build/partial.rdb)
65
> ## ("unexpected_macro_expansion" as there is no build/partial.rdb)
67
> 
66
> 
68
> 
-
 
69
> ## FIXME: "srcref" of usermacro expansion such as from \bibshow{*}
-
 
70
> rd <- parse_Rd(textConnection(r"(\newcommand{\Emph}{\emph{#1}}
-
 
71
+ \Emph{this}
-
 
72
+ )"), fragment = TRUE, verbose = TRUE, macros = FALSE)
-
 
73
0:0: STARTFRAGMENT: 
-
 
74
1:1: NEWCOMMAND: \newcommand
-
 
75
1:12: '{'
-
 
76
1:13: VERB: \Emph
-
 
77
1:18: '}'
-
 
78
1:19: '{'
-
 
79
1:20: VERB: \emph{#1}
-
 
80
1:29: '}'
-
 
81
1:30: TEXT: 
-
 
82
 
-
 
83
2:1: USERMACRO1: \Emph
-
 
84
2:6: '{'
-
 
85
2:7: VERB: this
-
 
86
2:11: '}'
-
 
87
2:12: LATEXMACRO: \emph
-
 
88
2:12: '{'
-
 
89
2:12: TEXT: this
-
 
90
2:12: '}'
-
 
91
2:12: TEXT: 
-
 
92
 
-
 
93
3:1: TEXT: 
-
 
94
 
-
 
95
4:1: END_OF_INPUT
-
 
96
> rd
-
 
97
 
-
 
98
\emph{this}
-
 
99
 
-
 
100
> print(lapply(rd, getSrcref), useSource = FALSE)
-
 
101
[[1]]
-
 
102
<srcref: file "<connection>" chars 1:1 to 1:29>
-
 
103
 
-
 
104
[[2]]
-
 
105
<srcref: file "<connection>" chars 1:30 to 1:30>
-
 
106
 
-
 
107
[[3]]
-
 
108
<srcref: file "<connection>" chars 2:1 to 2:11>
-
 
109
 
-
 
110
[[4]]
-
 
111
<srcref: file "<connection>" chars 2:12 to 2:11>
-
 
112
 
-
 
113
[[5]]
-
 
114
<srcref: file "<connection>" chars 2:12 to 2:12>
-
 
115
 
-
 
116
[[6]]
-
 
117
<srcref: file "<connection>" chars 3:1 to 3:1>
-
 
118
 
-
 
119
> ## The expansion [[4]] currently refers to source "chars 2:12 to 2:11".
-
 
120
> ## We would need this to refer to column 1 (re-use the invocations "srcref")
-
 
121
> ## such that also in R < 4.6.0, Rd2HTML() would addParaBreaks()
-
 
122
> ## for multiple references separated by blank lines in bibshow's \Sexpr result.
-
 
123
> 
-
 
124
> proc.time()
67
> proc.time()
125
   user  system elapsed 
68
   user  system elapsed 
126
  0.221   0.045   0.254 
69
  0.194   0.022   0.211