The R Project SVN R

Rev

Rev 36820 | Rev 39996 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36820 Rev 36990
Line 29... Line 29...
29
#include <Rconnections.h>
29
#include <Rconnections.h>
30
 
30
 
31
extern IoBuffer R_ConsoleIob;
31
extern IoBuffer R_ConsoleIob;
32
/* extern int errno; No longer used */
32
/* extern int errno; No longer used */
33
 
33
 
34
SEXP getParseContext()
34
SEXP attribute_hidden getParseContext()
35
{
35
{
36
    int i, last = PARSE_CONTEXT_SIZE;
36
    int i, last = PARSE_CONTEXT_SIZE;
37
    char context[PARSE_CONTEXT_SIZE+1];
37
    char context[PARSE_CONTEXT_SIZE+1];
38
 
38
 
39
    SEXP ans = R_NilValue, ans2;
39
    SEXP ans = R_NilValue, ans2;
Line 80... Line 80...
80
	SET_STRING_ELT(ans2, i, STRING_ELT(ans, i));
80
	SET_STRING_ELT(ans2, i, STRING_ELT(ans, i));
81
    UNPROTECT(2);
81
    UNPROTECT(2);
82
    return ans2;
82
    return ans2;
83
}    
83
}    
84
 
84
 
85
void parseError(SEXP call, int linenum)
85
void attribute_hidden parseError(SEXP call, int linenum)
86
{
86
{
87
    SEXP context = getParseContext();
87
    SEXP context = getParseContext();
88
    int len = length(context);
88
    int len = length(context);
89
    if (linenum) {
89
    if (linenum) {
90
	switch (len) {
90
	switch (len) {
Line 112... Line 112...
112
 The internal R_Parse.. functions are defined in ./gram.y (-> gram.c)
112
 The internal R_Parse.. functions are defined in ./gram.y (-> gram.c)
113
 
113
 
114
 .Internal( parse(file, n, text, prompt) )
114
 .Internal( parse(file, n, text, prompt) )
115
 If there is text then that is read and the other arguments are ignored.
115
 If there is text then that is read and the other arguments are ignored.
116
*/
116
*/
117
SEXP do_parse(SEXP call, SEXP op, SEXP args, SEXP env)
117
SEXP attribute_hidden do_parse(SEXP call, SEXP op, SEXP args, SEXP env)
118
{
118
{
119
    SEXP text, prompt, s;
119
    SEXP text, prompt, s;
120
    Rconnection con;
120
    Rconnection con;
121
    Rboolean wasopen;
121
    Rboolean wasopen;
122
    int ifile, num;
122
    int ifile, num;