Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/yamlPublic

Commitafde119

Browse files
authored
Merge pull request#145 from shikokuchuo/master
Fix non-API calls for closures
2 parents8d6f7c3 +903a78a commitafde119

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

‎DESCRIPTION‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ Package: yaml
22
Type: Package
33
Title: Methods to Convert R Data to YAML and Back
44
Date: 2023-11-28
5-
Version: 2.3.8
5+
Version: 2.3.9
66
Suggests: RUnit
77
Author: Shawn P Garbett [aut], Jeremy Stephens [aut, cre], Kirill Simonov [aut], Yihui Xie [ctb],
88
Zhuoer Dong [ctb], Hadley Wickham [ctb], Jeffrey Horner [ctb], reikoch [ctb],
99
Will Beasley [ctb], Brendan O'Connor [ctb], Gregory R. Warnes [ctb],
10-
Michael Quinn [ctb], Zhian N. Kamvar [ctb]
10+
Michael Quinn [ctb], Zhian N. Kamvar [ctb], Charlie Gao [ctb]
1111
Maintainer: Shawn Garbett <shawn.garbett@vumc.org>
1212
License: BSD_3_clause + file LICENSE
1313
Description: Implements the 'libyaml' 'YAML' 1.1 parser and emitter

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3.8
1+
2.3.9

‎src/r_emit.c‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,22 @@ typedef struct {
1111
size_tcapa;
1212
}s_emitter_output;
1313

14+
#ifR_VERSION<R_Version(4,5,0)
15+
16+
# defineR_ClosureFormals(x) FORMALS(x)
17+
# defineR_ClosureBody(x) BODY(x)
18+
# defineR_ClosureEnv(x) CLOENV(x)
19+
20+
staticinlineSEXPR_mkClosure(SEXPformals,SEXPbody,SEXPenv) {
21+
SEXPfun=Rf_allocSExp(CLOSXP);
22+
SET_FORMALS(fun,formals);
23+
SET_BODY(fun,body);
24+
SET_CLOENV(fun,env);
25+
returnfun;
26+
}
27+
28+
#endif
29+
1430
staticSEXPRyaml_deparse_function(SEXPs_obj)
1531
{
1632
SEXPs_new_obj=NULL,s_call=NULL,s_result=NULL,s_chr=NULL;
@@ -20,10 +36,7 @@ static SEXP Ryaml_deparse_function(SEXP s_obj)
2036
/* Copy function without any attributes */
2137
if (TYPEOF(s_obj)==CLOSXP) {
2238
PROTECT(s_obj);
23-
PROTECT(s_new_obj=allocSExp(CLOSXP));
24-
SET_FORMALS(s_new_obj,FORMALS(s_obj));
25-
SET_BODY(s_new_obj,BODY(s_obj));
26-
SET_CLOENV(s_new_obj,CLOENV(s_obj));
39+
PROTECT(s_new_obj=R_mkClosure(R_ClosureFormals(s_obj),R_ClosureBody(s_obj),R_ClosureEnv(s_obj)));
2740
SET_OBJECT(s_new_obj,OBJECT(s_obj));
2841
UNPROTECT(2);
2942
s_obj=s_new_obj;

‎src/r_ext.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include<limits.h>
1313
#include"R.h"
1414
#include"Rdefines.h"
15+
#include"Rversion.h"
1516
#include"R_ext/Rdynload.h"
1617
#include"R_ext/Parse.h"
1718
#include"R_ext/Print.h"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp